Class: I18nAdmin::ExportsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/i18n_admin/exports_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_locale, #current_user

Instance Method Details

#showObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/i18n_admin/exports_controller.rb', line 3

def show
  respond_to do |format|
    format.html do
      @job_id = Export::XLS.perform_async(current_locale.to_s)
      render 'queued', layout: false
    end

    format.xls do
      job = Export::XLS.new
      job.perform(current_locale.to_s)

      redirect_to job.export_file.file.url
    end
  end
end