27 lines
451 B
Ruby
27 lines
451 B
Ruby
# frozen_string_literal: true
|
|
|
|
class PassportsController < ApplicationController
|
|
before_action :set_passport, except: %i[index new]
|
|
|
|
# GET /passports
|
|
def index
|
|
@passports = policy_scope(Passport)
|
|
end
|
|
|
|
# GET /passports/:id
|
|
def show
|
|
authorize @passport
|
|
end
|
|
|
|
# GET /passports/new
|
|
def new
|
|
@passport = Passport.new
|
|
authorize @passport
|
|
end
|
|
|
|
private
|
|
|
|
def set_passport
|
|
@passport = Passport.find params[:id]
|
|
end
|
|
end
|