Class: Decidim::Meetings::Admin::MeetingClosesController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- Admin::ApplicationController
- Admin::Components::BaseController
- ApplicationController
- Decidim::Meetings::Admin::MeetingClosesController
- Defined in:
- decidim-meetings/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb
Overview
This controller allows an admin to manage meetings from a Participatory Process
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods inherited from Admin::Components::BaseController
#current_component, #current_participatory_space, #parent_path, #permission_class_chain, #permission_scope, #permissions_context, #set_component_breadcrumb_item, #skip_manage_component_permission
Methods included from RegistersPermissions
Methods inherited from Admin::ApplicationController
#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path
Methods included from Headers::HttpCachingDisabler
Methods included from NeedsSnippets
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#edit ⇒ Object
10 11 12 13 14 |
# File 'decidim-meetings/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb', line 10 def edit (:close, :meeting, meeting:) @form = form(Admin::CloseMeetingForm).from_model(meeting) end |
#update ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'decidim-meetings/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb', line 16 def update (:close, :meeting, meeting:) @form = form(Admin::CloseMeetingForm).from_params(params.merge(proposals: meeting.sibling_scope(:proposals))) CloseMeeting.call(@form, meeting) do on(:ok) do flash[:notice] = I18n.t("meetings.close.success", scope: "decidim.meetings.admin") redirect_to meetings_path end on(:invalid) do flash.now[:alert] = I18n.t("meetings.close.invalid", scope: "decidim.meetings.admin") render action: "edit" end end end |