Sha256: 1cfc248bff21bbc41afdb6119ecc1429bc8115f011a9c7c5ab0bb45bdd45f8fc
Contents?: true
Size: 1.65 KB
Versions: 13
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
13 entries across 13 versions & 2 rubygems