Sha256: f64d1ecee6488c544d094dffe83c7231ec77c9d808a8d03b4ae3689a8a7cd1a9

Contents?: true

Size: 1.59 KB

Versions: 34

Compression:

Stored size: 1.59 KB

Contents

class AgentImportResultsController < ApplicationController
  before_action :set_agent_import_result, only: [:show, :edit, :update, :destroy]
  before_action :check_policy, only: [:index]

  # GET /agent_import_results
  # GET /agent_import_results.json
  def index
    @agent_import_file = AgentImportFile.where(id: params[:agent_import_file_id]).first
    if @agent_import_file
      @agent_import_results = @agent_import_file.agent_import_results.page(params[:page])
    else
      @agent_import_results = AgentImportResult.page(params[:page])
    end

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

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

  # DELETE /agent_import_results/1
  # DELETE /agent_import_results/1.json
  def destroy
    @agent_import_result.destroy

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

  private
  def set_agent_import_result
    @agent_import_result = AgentImportResult.find(params[:id])
    authorize @agent_import_result
  end

  def check_policy
    authorize AgentImportResult
  end

  def agent_import_result_params
    params.require(:agent_import_result).permit(
      :agent_import_file_id, :agent_id, :body
    )
  end
end

Version data entries

34 entries across 33 versions & 2 rubygems

Version Path
enju_biblio-0.3.13 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.12 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.11 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.10 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.10.rc.3 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.10.rc.2 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.10.rc.1 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.9 app/controllers/agent_import_results_controller.rb
enju_biblio-0.4.0.rc.1 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.8 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.7 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.6 app/controllers/agent_import_results_controller.rb
enju_biblio-0.4.0.beta.2 app/controllers/agent_import_results_controller.rb
enju_biblio-0.4.0.beta.1 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.5 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.4 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.3 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.2 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.1 app/controllers/agent_import_results_controller.rb
enju_biblio-0.3.0 app/controllers/agent_import_results_controller.rb