Sha256: 2351f203404a2819d74b675ac1466eccfb2711dbe3355cb23d83f07dc751aed9
Contents?: true
Size: 945 Bytes
Versions: 13
Compression:
Stored size: 945 Bytes
Contents
# frozen_string_literal: true module Decidim module Assemblies module Admin class AssemblyImportsController < Decidim::Assemblies::Admin::ApplicationController layout "decidim/admin/assemblies_imports" def new enforce_permission_to :import, :assembly @form = form(AssemblyImportForm).instance end def create enforce_permission_to :import, :assembly @form = form(AssemblyImportForm).from_params(params) ImportAssembly.call(@form, current_user) do on(:ok) do flash[:notice] = I18n.t("assembly_imports.create.success", scope: "decidim.admin") redirect_to assemblies_path end on(:invalid) do flash.now[:alert] = I18n.t("assembly_imports.create.error", scope: "decidim.admin") render :new end end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems