Class: Decidim::AccessRequests::Verification::AuthorizationsController
- Inherits:
-
Decidim::ApplicationController
- Object
- Decidim::ApplicationController
- Decidim::AccessRequests::Verification::AuthorizationsController
- Defined in:
- app/controllers/decidim/access_requests/verification/authorizations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/decidim/access_requests/verification/authorizations_controller.rb', line 17 def create :create, :authorization, authorization: @authorization @form = RequestForm.from_params( params.merge(user: current_user) ).with_context(current_organization: current_organization) Decidim::Verifications::PerformAuthorizationStep.call(@authorization, @form) do on(:ok) do flash[:notice] = t("authorizations.create.success", scope: "decidim.access_requests.verification") redirect_to decidim_verifications. end on(:invalid) do flash.now[:alert] = t("authorizations.create.error", scope: "decidim.access_requests.verification") render :new end end end |
#edit ⇒ Object
37 38 39 |
# File 'app/controllers/decidim/access_requests/verification/authorizations_controller.rb', line 37 def edit :create, :authorization, authorization: @authorization end |
#new ⇒ Object
11 12 13 14 15 |
# File 'app/controllers/decidim/access_requests/verification/authorizations_controller.rb', line 11 def new :create, :authorization, authorization: @authorization @form = RequestForm.new(handler_handle: ) end |