Class: Decidim::Conferences::ConferenceRegistrationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Decidim::Conferences::ConferenceRegistrationsController
- Defined in:
- app/controllers/decidim/conferences/conference_registrations_controller.rb
Overview
Exposes the registration resource so users can join and leave conferences.
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/decidim/conferences/conference_registrations_controller.rb', line 9 def create (:join, :conference, conference:) JoinConference.call(conference, registration_type, current_user) do on(:ok) do flash[:notice] = I18n.t("conference_registrations.create.success", scope: "decidim.conferences") redirect_after_path end on(:invalid) do flash.now[:alert] = I18n.t("conference_registrations.create.invalid", scope: "decidim.conferences") redirect_after_path end end end |
#decline_invitation ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/decidim/conferences/conference_registrations_controller.rb', line 41 def decline_invitation (:decline_invitation, :conference, conference:) DeclineInvitation.call(conference, current_user) do on(:ok) do flash[:notice] = I18n.t("conference_registrations.decline_invitation.success", scope: "decidim.conferences") redirect_after_path end on(:invalid) do flash.now[:alert] = I18n.t("conference_registrations.decline_invitation.invalid", scope: "decidim.conferences") redirect_after_path end end end |
#destroy ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/decidim/conferences/conference_registrations_controller.rb', line 25 def destroy (:leave, :conference, conference:) LeaveConference.call(conference, registration_type, current_user) do on(:ok) do flash[:notice] = I18n.t("conference_registrations.destroy.success", scope: "decidim.conferences") redirect_after_path end on(:invalid) do flash.now[:alert] = I18n.t("conference_registrations.destroy.invalid", scope: "decidim.conferences") redirect_after_path end end end |