Sha256: bd6332384730c510aa0bea063a29d5c3c695430bf5d5642b0196a45d426d1d52
Contents?: true
Size: 880 Bytes
Versions: 33
Compression:
Stored size: 880 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) 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
33 entries across 33 versions & 1 rubygems