Class: UserOptionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/user_options_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #api_authenticate!, #authenticated_via_token?, #current_project, #expire_revision!, #followed_projects, #no_cache, #oauth_authorize!, #read_revision, #require_login, #return_or_cache_revision!, #revision, #token_authenticate!, #unfurling?, #with_current_project

Methods included from UrlHelper

#feature_path, #link_to_project_feature

Instance Method Details

#destroyObject



12
13
14
15
16
# File 'app/controllers/user_options_controller.rb', line 12

def destroy
  current_user.props.delete! params[:key]
  current_user.save!
  head :ok
end

#updateObject



5
6
7
8
9
# File 'app/controllers/user_options_controller.rb', line 5

def update
  current_user.props.merge! params[:options].to_unsafe_hash # <-- TODO: should props be declared and then permitted?
  current_user.save!
  head :ok
end