Class: I18nAdmin::ImportsController
Instance Method Summary
collapse
#current_locale, #current_user
Instance Method Details
#create ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/i18n_admin/imports_controller.rb', line 15
def create
unless params[:file].present?
flash[:error] = t('i18n_admin.imports.please_choose_file')
render 'new'
return
end
@job = ImportJob.create!(locale: current_locale, filename: params[:file].original_filename)
Import::Job.perform_async(current_locale, params[:file], @job.id)
render 'processing'
end
|
#new ⇒ Object
12
13
|
# File 'app/controllers/i18n_admin/imports_controller.rb', line 12
def new
end
|
#show ⇒ Object
3
4
5
6
7
8
9
10
|
# File 'app/controllers/i18n_admin/imports_controller.rb', line 3
def show
respond_to do |format|
format.json do
job = ImportJob.find(params[:id])
render json: job.as_json(only: [:id, :filename, :state])
end
end
end
|