Class: UserSettingsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- UserSettingsController
- Defined in:
- app/controllers/user_settings_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
/settings.
-
#show ⇒ Object
/users/123/settings.
- #update ⇒ Object
Methods inherited from ApplicationController
#current_navable, #current_navable=, #current_user, #point_navigation_to, #redirect_www_subdomain, #set_locale
Instance Method Details
#index ⇒ Object
/settings
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/user_settings_controller.rb', line 6 def index :update, user @user = user @navable = @user @user.update_last_seen_activity "nimmt Benutzereinstellungen vor" render action: 'show' end |
#show ⇒ Object
/users/123/settings
18 19 20 21 22 23 24 |
# File 'app/controllers/user_settings_controller.rb', line 18 def show @user = user :update, user @navable = @user current_user.update_last_seen_activity "nimmt Benutzereinstellungen vor" end |
#update ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/user_settings_controller.rb', line 26 def update @user = user :update, @user if not user_params[:incognito].nil? if user_params[:incognito] == true current_user.update_last_seen_activity nil end if user_params[:incognito] == 'true' @user.incognito = true elsif user_params[:incognito] == 'false' @user.incognito = false end @user.save end render nothing: true end |