Sha256: 528da72986443680c1cacff618fe24582e36075804be8f87879ab86bdda515b8

Contents?: true

Size: 1.69 KB

Versions: 27

Compression:

Stored size: 1.69 KB

Contents

class ResourceImportResultsController < ApplicationController
  before_action :set_resource_import_result, only: [:show, :edit, :update, :destroy]
  before_action :check_policy, only: [:index]

  # GET /resource_import_results
  # GET /resource_import_results.json
  def index
    @resource_import_file = ResourceImportFile.where(id: params[:resource_import_file_id]).first
    if @resource_import_file
      @resource_import_results = @resource_import_file.resource_import_results.page(params[:page])
    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.txt
    end
  end

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

  # DELETE /resource_import_results/1
  # DELETE /resource_import_results/1.json
  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

  private
  def set_resource_import_result
    @resource_import_result = ResourceImportResult.find(params[:id])
    authorize @resource_import_result
  end

  def check_policy
    authorize ResourceImportResult
  end

  def resource_import_result_params
    params.require(:resource_import_result).permit(
      :resource_import_file_id, :manifestation_id, :item_id, :body
    )
  end
end

Version data entries

27 entries across 26 versions & 2 rubygems

Version Path
enju_biblio-0.3.9 app/controllers/resource_import_results_controller.rb
enju_biblio-0.4.0.rc.1 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.8 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.7 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.6 app/controllers/resource_import_results_controller.rb
enju_biblio-0.4.0.beta.2 app/controllers/resource_import_results_controller.rb
enju_biblio-0.4.0.beta.1 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.5 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.4 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.3 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.2 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.1 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.0 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.0.rc.1 app/controllers/resource_import_results_controller.rb
enju_biblio-0.3.0.beta.2 app/controllers/resource_import_results_controller.rb
enju_biblio-0.2.5 app/controllers/resource_import_results_controller.rb
enju_biblio-0.2.4 app/controllers/resource_import_results_controller.rb
enju_biblio-0.2.3 app/controllers/resource_import_results_controller.rb
enju_biblio-0.2.2 app/controllers/resource_import_results_controller.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_biblio-0.2.1/app/controllers/resource_import_results_controller.rb