Class: ResourceImportResultsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/resource_import_results_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject

DELETE /resource_import_results/1 DELETE /resource_import_results/1.json



37
38
39
40
41
42
43
44
# File 'app/controllers/resource_import_results_controller.rb', line 37

def destroy
  @resource_import_result.destroy

  respond_to do |format|
    format.html { redirect_to resource_import_results_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.resource_import_result')) }
    format.json { head :no_content }
  end
end

#indexObject

GET /resource_import_results GET /resource_import_results.json



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/resource_import_results_controller.rb', line 7

def index
  @resource_import_file = ResourceImportFile.find_by(id: params[:resource_import_file_id])
  if @resource_import_file
    if params[:format].to_s.downcase == 'text'
      @resource_import_results = @resource_import_file.resource_import_results
    else
      @resource_import_results = @resource_import_file.resource_import_results.page(params[:page])
    end
  else
    @resource_import_results = ResourceImportResult.page(params[:page])
  end

  respond_to do |format|
    format.html # index.html.erb
    format.json { render json: @resource_import_results }
    format.text
  end
end

#showObject

GET /resource_import_results/1 GET /resource_import_results/1.json



28
29
30
31
32
33
# File 'app/controllers/resource_import_results_controller.rb', line 28

def show
  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @resource_import_result }
  end
end