Sha256: fabfa52d4050eb2be79cf6ad09b523ad80d352c4931cc60012e20785ab732eb6
Contents?: true
Size: 1.08 KB
Versions: 3
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true require_dependency "decidim/admin/application_controller" module Decidim module Meetings module Admin # Controller that allows inviting users to join a meeting. # class InvitesController < Admin::ApplicationController def new @form = form(MeetingRegistrationInviteForm).instance end def create @form = form(MeetingRegistrationInviteForm).from_params(params) InviteUserToJoinMeeting.call(@form, meeting, current_user) do on(:ok) do flash[:notice] = I18n.t("invites.create.success", scope: "decidim.meetings.admin") redirect_to edit_meeting_registrations_path(meeting) end on(:invalid) do flash.now[:alert] = I18n.t("invites.create.error", scope: "decidim.meetings.admin") render :new end end end private def meeting @meeting ||= Meeting.where(component: current_component).find(params[:meeting_id]) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems