Sha256: 2f33709ab9b7a26b43b5049b9e54017fedac44761f8b5c26588b3baf275138c9

Contents?: true

Size: 1.57 KB

Versions: 19

Compression:

Stored size: 1.57 KB

Contents

class UserImportResultsController < ApplicationController
  before_action :set_user_import_result, only: [:show, :edit, :update, :destroy]
  before_action :check_policy, only: [:index, :new, :create]

  # GET /user_import_results
  # GET /user_import_results.json
  def index
    @user_import_file = UserImportFile.where(id: params[:user_import_file_id]).first
    if @user_import_file
      @user_import_results = @user_import_file.user_import_results.page(params[:page])
    else
      @user_import_results = UserImportResult.page(params[:page])
    end

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

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

  # DELETE /user_import_results/1
  # DELETE /user_import_results/1.json
  def destroy
    @user_import_result.destroy

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

  private
  def set_user_import_result
    @user_import_result = UserImportResult.find(params[:id])
    authorize @user_import_result
  end

  def check_policy
    authorize UserImportResult
  end

  def user_import_result_params
    params.require(:user_import_result).permit(
      :user_import_file_id, :user_id, :body
    )
  end
end

Version data entries

19 entries across 17 versions & 2 rubygems

Version Path
enju_library-0.2.5 app/controllers/user_import_results_controller.rb
enju_library-0.2.4 app/controllers/user_import_results_controller.rb
enju_library-0.2.3 app/controllers/user_import_results_controller.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.2/app/controllers/user_import_results_controller.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.1/app/controllers/user_import_results_controller.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/bundler/gems/enju_library-d36f415e177e/app/controllers/user_import_results_controller.rb
enju_library-0.2.2 app/controllers/user_import_results_controller.rb
enju_library-0.2.1 app/controllers/user_import_results_controller.rb
enju_library-0.2.0 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.10 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.9 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.8 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.7 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.6 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.5 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.4 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.3 app/controllers/user_import_results_controller.rb
enju_library-0.2.0.beta.2 app/controllers/user_import_results_controller.rb
enju_leaf-1.2.0.beta.1 app/controllers/user_import_results_controller.rb