Class: Para::Admin::ImportsController

Inherits:
JobsController show all
Defined in:
app/controllers/para/admin/imports_controller.rb

Instance Method Summary collapse

Methods inherited from JobsController

#show

Methods inherited from BaseController

#current_ability, #current_admin

Methods included from BaseHelper

#find_partial_for, #find_relation_name_for, #flash_message, #registered_components_options, #resource_title_for, #template_path_lookup

Methods included from Helpers::ResourceName

#resource_name

Methods inherited from Para::ApplicationController

#admin?

Instance Method Details

#createObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/para/admin/imports_controller.rb', line 13

def create
  @file = Para::Library::File.new(file_params)

  if @file.save
    job = @importer.perform_later(@file)

    track_job(job)
  else
    render 'new', status: 422
  end
end

#newObject



8
9
10
11
# File 'app/controllers/para/admin/imports_controller.rb', line 8

def new
  @file = Para::Library::File.new
  @model = resource_model
end