Class: Decidim::Elections::TrusteeZone::TrusteesController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- ApplicationController
- Decidim::Elections::TrusteeZone::TrusteesController
- Includes:
- FormFactory
- Defined in:
- decidim-elections/app/controllers/decidim/elections/trustee_zone/trustees_controller.rb
Overview
Exposes the trustee zone for trustee users
Instance Method Summary collapse
Methods included from UserProfile
#available_verification_workflows
Methods included from UserGroups
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from Headers::HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#show ⇒ Object
10 11 12 13 14 |
# File 'decidim-elections/app/controllers/decidim/elections/trustee_zone/trustees_controller.rb', line 10 def show (:view, :trustee, trustee:) trustee.name ||= current_user.name end |
#update ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'decidim-elections/app/controllers/decidim/elections/trustee_zone/trustees_controller.rb', line 16 def update (:update, :trustee, trustee:) form = form(TrusteeForm).from_params(params, trustee:) UpdateTrustee.call(form) do on(:ok) do flash[:notice] = I18n.t("trustees.update.success", scope: "decidim.elections.trustee_zone") end on(:invalid) do flash[:alert] = form.errors..to_sentence end end redirect_to trustee_path end |