Module: Recruiter::FormHelper

Defined in:
app/helpers/recruiter/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#options_for(scope) ⇒ Object



19
20
21
22
23
# File 'app/helpers/recruiter/form_helper.rb', line 19

def options_for(scope)
  scope.order(:name).select(:name, :id).map do |row|
    [row.name, row.id]
  end
end

#options_for_available_cities(state_id) ⇒ Object



11
12
13
# File 'app/helpers/recruiter/form_helper.rb', line 11

def options_for_available_cities(state_id)
  options_for City.with_open_jobs.where(state_id: state_id)
end

#options_for_available_statesObject



7
8
9
# File 'app/helpers/recruiter/form_helper.rb', line 7

def options_for_available_states
  options_for(State.with_open_jobs)
end

#options_for_cities(state_id = nil) ⇒ Object



15
16
17
# File 'app/helpers/recruiter/form_helper.rb', line 15

def options_for_cities(state_id = nil)
  options_for City.where(state_id: state_id)
end

#options_for_statesObject



3
4
5
# File 'app/helpers/recruiter/form_helper.rb', line 3

def options_for_states
  options_for(State)
end

#tagsObject



25
26
27
# File 'app/helpers/recruiter/form_helper.rb', line 25

def tags
  Tag.order(:sequence)
end