Sha256: ecef822f5fdde7afba69b84a92091b257ee41f2af03bfbda0b8ae9b074bc44c3
Contents?: true
Size: 1014 Bytes
Versions: 11
Compression:
Stored size: 1014 Bytes
Contents
# frozen_string_literal: true module Decidim module Assemblies module Admin # Controller that allows managing assemblies. # class AssemblyCopiesController < Decidim::Assemblies::Admin::ApplicationController include Concerns::AssemblyAdmin def new enforce_permission_to :create, :assembly @form = form(AssemblyCopyForm).from_model(current_assembly) end def create enforce_permission_to :create, :assembly @form = form(AssemblyCopyForm).from_params(params) CopyAssembly.call(@form, current_assembly) do on(:ok) do flash[:notice] = I18n.t("assemblies_copies.create.success", scope: "decidim.admin") redirect_to assemblies_path end on(:invalid) do flash.now[:alert] = I18n.t("assemblies_copies.create.error", scope: "decidim.admin") render :new end end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems