Class: Decidim::AccountController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Decidim::AccountController
- Includes:
- UserProfile
- Defined in:
- app/controllers/decidim/account_controller.rb
Overview
The controller to handle the user’s account page.
Instance Method Summary collapse
Methods included from UserProfile
#available_authorization_handlers
Methods inherited from ApplicationController
Instance Method Details
#show ⇒ Object
10 11 12 13 |
# File 'app/controllers/decidim/account_controller.rb', line 10 def show :show, current_user @account = form(AccountForm).from_model(current_user) end |
#update ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/decidim/account_controller.rb', line 15 def update :update, current_user @account = form(AccountForm).from_params(params) UpdateAccount.call(current_user, @account) do on(:ok) do |_account, unconfirmed_email| flash.now[:notice] = if unconfirmed_email t("account.update.success_with_email_confirmation", scope: "decidim") else t("account.update.success", scope: "decidim") end bypass_sign_in(current_user) end on(:invalid) do flash.now[:alert] = t("account.update.error", scope: "decidim") end end render action: :show end |