Class: Locomotive::MyAccountController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::MyAccountController
- Defined in:
- app/controllers/locomotive/my_account_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
12 13 14 15 |
# File 'app/controllers/locomotive/my_account_controller.rb', line 12 def edit @account respond_with @account end |
#regenerate_api_key ⇒ Object
28 29 30 31 32 |
# File 'app/controllers/locomotive/my_account_controller.rb', line 28 def regenerate_api_key @account, :update? @account.regenerate_api_key! respond_with({ api_key: @account.api_key }, location: edit_my_account_path) end |
#update ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/locomotive/my_account_controller.rb', line 17 def update @account if needs_password? @account.update_with_password(account_params) else @account.update_attributes(account_params) end params[:active_tab] = 'credentials' if @account.errors.include?(:current_password) respond_with @account, location: edit_my_account_path(anchor: params[:active_tab]) end |