Module: Decidim::Admin::ExportsHelper

Defined in:
app/helpers/decidim/admin/exports_helper.rb

Instance Method Summary collapse

Instance Method Details

#export_dropdown(component = current_component, resource_id = nil) ⇒ Object

Renders an export dropdown for the provided component, including an item for each exportable artifact and format.

component - The component to render the export dropdown for. Defaults to the

current component.

Returns a rendered dropdown.



13
14
15
# File 'app/helpers/decidim/admin/exports_helper.rb', line 13

def export_dropdown(component = current_component, resource_id = nil)
  render partial: "decidim/admin/exports/dropdown", locals: { component: component, resource_id: resource_id }
end

#exports_path(component, options) ⇒ Object

Routes to the correct exporter for a component.

component - The component to be routed. options - Extra options that need to be passed to the route.

Returns the path to the component exporter.



23
24
25
# File 'app/helpers/decidim/admin/exports_helper.rb', line 23

def exports_path(component, options)
  EngineRouter.admin_proxy(component.participatory_space).component_exports_path(options.merge(component_id: component))
end