Sha256: b99d9289e1ba1dc95b8a61e0b2d7dc3502d8a64dcac2099e5a535d639554df2d
Contents?: true
Size: 894 Bytes
Versions: 12
Compression:
Stored size: 894 Bytes
Contents
# frozen_string_literal: true module Decidim module Assemblies module Admin class AssemblyImportsController < Decidim::Assemblies::Admin::ApplicationController 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
12 entries across 12 versions & 1 rubygems