Sha256: fcab372f8a10dd9b9c1808284c8f8c6c7b1b44ae7d5981423d74c01d9d6f0cae
Contents?: true
Size: 1.65 KB
Versions: 54
Compression:
Stored size: 1.65 KB
Contents
# frozen_string_literal: true module Decidim module Meetings module Admin # This controller allows an admin to manage meetings from a Participatory Process class MeetingsController < Admin::ApplicationController def new @form = form(MeetingForm).instance end def create @form = form(MeetingForm).from_params(params, current_feature: current_feature) CreateMeeting.call(@form) do on(:ok) do flash[:notice] = I18n.t("meetings.create.success", scope: "decidim.meetings.admin") redirect_to meetings_path end on(:invalid) do flash.now[:alert] = I18n.t("meetings.create.invalid", scope: "decidim.meetings.admin") render action: "new" end end end def edit @form = form(MeetingForm).from_model(meeting) end def update @form = form(MeetingForm).from_params(params, current_feature: current_feature) UpdateMeeting.call(@form, meeting) do on(:ok) do flash[:notice] = I18n.t("meetings.update.success", scope: "decidim.meetings.admin") redirect_to meetings_path end on(:invalid) do flash.now[:alert] = I18n.t("meetings.update.invalid", scope: "decidim.meetings.admin") render action: "edit" end end end def destroy meeting.destroy! flash[:notice] = I18n.t("meetings.destroy.success", scope: "decidim.meetings.admin") redirect_to meetings_path end end end end end
Version data entries
54 entries across 54 versions & 2 rubygems