Class: Decidim::Assemblies::Admin::AssemblyImportsController
- Inherits:
-
ApplicationController
- Object
- Decidim::Admin::ApplicationController
- ApplicationController
- Decidim::Assemblies::Admin::AssemblyImportsController
- Defined in:
- app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb', line 14 def create :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 |
#new ⇒ Object
9 10 11 12 |
# File 'app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb', line 9 def new :import, :assembly @form = form(AssemblyImportForm).instance end |