Class: Decidim::Meetings::RegistrationsController
- Inherits:
-
ApplicationController
- Object
- Features::BaseController
- ApplicationController
- Decidim::Meetings::RegistrationsController
- Defined in:
- app/controllers/decidim/meetings/registrations_controller.rb
Overview
Exposes the registration resource so users can join and leave meetings.
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/decidim/meetings/registrations_controller.rb', line 7 def create :join, meeting JoinMeeting.call(meeting, current_user) do on(:ok) do flash[:notice] = I18n.t("registrations.create.success", scope: "decidim.meetings") redirect_to meeting_path(meeting) end on(:invalid) do flash.now[:alert] = I18n.t("registrations.create.invalid", scope: "decidim.meetings") redirect_to meeting_path(meeting) end end end |
#destroy ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/decidim/meetings/registrations_controller.rb', line 23 def destroy :leave, meeting LeaveMeeting.call(meeting, current_user) do on(:ok) do flash[:notice] = I18n.t("registrations.destroy.success", scope: "decidim.meetings") redirect_to meeting_path(meeting) end on(:invalid) do flash.now[:alert] = I18n.t("registrations.destroy.invalid", scope: "decidim.meetings") redirect_to meeting_path(meeting) end end end |