Class: Decidim::Conferences::Admin::ConferenceInvitesController
- Inherits:
-
ApplicationController
- Object
- Admin::ApplicationController
- ApplicationController
- Decidim::Conferences::Admin::ConferenceInvitesController
- Defined in:
- app/controllers/decidim/conferences/admin/conference_invites_controller.rb
Overview
Controller that allows inviting users to join a conference.
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/decidim/conferences/admin/conference_invites_controller.rb', line 29 def create (:invite_attendee, :conference, conference: current_participatory_space) @form = form(ConferenceRegistrationInviteForm).from_params(params) InviteUserToJoinConference.call(@form, current_participatory_space, current_user) do on(:ok) do flash[:notice] = I18n.t("conference_invites.create.success", scope: "decidim.conferences.admin") redirect_to conference_conference_invites_path(current_participatory_space) end on(:invalid) do flash.now[:alert] = I18n.t("conference_invites.create.error", scope: "decidim.conferences.admin") render :new end end end |
#index ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/decidim/conferences/admin/conference_invites_controller.rb', line 15 def index (:read_invites, :conference, conference: current_participatory_space) @query = params[:q] @status = params[:status] @conference_invites = Decidim::Conferences::Admin::ConferenceInvites.for(current_participatory_space.conference_invites, @query, @status).page(params[:page]).per(15) end |
#new ⇒ Object
23 24 25 26 27 |
# File 'app/controllers/decidim/conferences/admin/conference_invites_controller.rb', line 23 def new (:invite_attendee, :conference, conference: current_participatory_space) @form = form(ConferenceRegistrationInviteForm).instance end |