Class: Rearview::UserController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Rearview::UserController
- Defined in:
- app/controllers/rearview/user_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
6 7 8 |
# File 'app/controllers/rearview/user_controller.rb', line 6 def show @user = current_user end |
#update ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/rearview/user_controller.rb', line 9 def update # https://github.com/rails/rails/issues/8831 # https://github.com/rails/rails/issues/8832 preferences = JSON.parse(request.body.string).with_indifferent_access.try(:[],:preferences) @user = current_user if preferences.present? @user.preferences = preferences end @user.save! render :show end |