Class: Recruiter::FiltersController

Inherits:
RecruiterController show all
Defined in:
app/controllers/recruiter/filters_controller.rb

Instance Method Summary collapse

Methods inherited from RecruiterController

#page, #per_page

Methods included from CrudFlashMessagerHelper

#crud_flash, #set_crud_error_flash, #set_crud_success_flash

Instance Method Details

#indexObject



3
4
5
6
7
8
# File 'app/controllers/recruiter/filters_controller.rb', line 3

def index
  @records = ::Recruiter::Filters.filter(type, params).map do |record|
    { id: record.id, name: record.name }
  end
  render json: @records
end

#typeObject



10
11
12
# File 'app/controllers/recruiter/filters_controller.rb', line 10

def type
  params.require(:filter)
end