1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/controllers/federal_subjects_controller.rb

26 lines
591 B
Ruby
Raw Normal View History

2019-01-31 17:38:06 -05:00
# frozen_string_literal: true
2019-06-23 11:54:41 -04:00
class FederalSubjectsController < ApplicationController
include PaginalController
2019-06-23 11:59:44 -04:00
before_action :set_federal_subject, except: :index
2019-01-31 17:38:06 -05:00
2019-06-23 11:59:44 -04:00
# GET /federal_subjects
2019-01-31 17:38:06 -05:00
def index
2019-06-23 11:59:44 -04:00
authorize :federal_subject
@federal_subjects = policy_scope(FederalSubject).order_by_display_name
.page(active_page)
2019-01-31 17:38:06 -05:00
end
2019-07-22 06:39:32 -04:00
# GET /federal_subjects/:number
2019-01-31 17:38:06 -05:00
def show
2019-06-23 11:59:44 -04:00
authorize @federal_subject
2019-01-31 17:38:06 -05:00
end
private
2019-06-23 11:59:44 -04:00
def set_federal_subject
2019-07-22 06:39:32 -04:00
@federal_subject = FederalSubject.find_by! number: params[:number]
2019-01-31 17:38:06 -05:00
end
end