Class: Decidim::ExtraUserFields::Admin::ExtraUserFieldsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/decidim/extra_user_fields/admin/extra_user_fields_controller.rb

Overview

This controller is the abstract class from which all other controllers of this engine inherit.

Instance Method Summary collapse

Instance Method Details

#export_usersObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/decidim/extra_user_fields/admin/extra_user_fields_controller.rb', line 9

def export_users
  enforce_permission_to :read, :officialization

  ExportUsers.call(params[:format], current_user) do
    on(:ok) do |export_data|
      send_data export_data.read, type: "text/#{export_data.extension}", filename: export_data.filename("participants")
    end
  end
end