Class: Decidim::ActionDelegator::Admin::Consultations::ExportsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Consultations::NeedsConsultation, NeedsPermission
Defined in:
app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb

Direct Known Subclasses

Exports::SumOfWeightsController

Instance Method Summary collapse

Methods inherited from ApplicationController

#permission_class_chain

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
# File 'app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb', line 11

def create
  enforce_permission_to :export_consultation_results, :consultation, consultation: current_consultation

  ExportConsultationResultsJob.perform_later(current_user, current_consultation, type)

  flash[:notice] = t("decidim.admin.exports.notice")
  redirect_back(fallback_location: decidim_admin_consultations.results_consultation_path(current_consultation))
end

#typeObject



20
21
22
# File 'app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb', line 20

def type
  "type_and_weight"
end