Sha256: 7f949ae3267987e6a4d6bf85f0d75f8172b0c53c84c1e7e72e4103d0b8bd088c
Contents?: true
Size: 1.14 KB
Versions: 19
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses module Admin # Controller that allows managing participatory processes. # class ParticipatoryProcessCopiesController < Decidim::Admin::ApplicationController include Concerns::ParticipatoryProcessAdmin def new enforce_permission_to :create, :process @form = form(ParticipatoryProcessCopyForm).from_model(current_participatory_process) end def create enforce_permission_to :create, :process @form = form(ParticipatoryProcessCopyForm).from_params(params) CopyParticipatoryProcess.call(@form, current_participatory_process, current_user) do on(:ok) do flash[:notice] = I18n.t("participatory_processes_copies.create.success", scope: "decidim.admin") redirect_to participatory_processes_path end on(:invalid) do flash.now[:alert] = I18n.t("participatory_processes_copies.create.error", scope: "decidim.admin") render :new end end end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems