Sha256: f99876082df0bacc360ce80574cf4465f992eaf7860c1fabe5886d97bb2a138f
Contents?: true
Size: 1 KB
Versions: 12
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true module Decidim module Admin # This controller allows admins to manage proposals in a participatory process. class ExportsController < Decidim::Admin::ApplicationController include Decidim::ComponentPathHelper def create enforce_permission_to :export, :component_data, component: component name = params[:id] Decidim.traceability.perform_action!("export_component", component, current_user, { name: name, format: params[:format] || default_format }) do ExportJob.perform_later(current_user, component, name, params[:format] || default_format, params[:resource_id].presence) end flash[:notice] = t("decidim.admin.exports.notice") redirect_back(fallback_location: manage_component_path(component)) end private def default_format "json" end def component @component ||= current_participatory_space.components.find(params[:component_id]) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems