Module: ActionView::Helpers::FormOptionsHelper

Defined in:
lib/job_function.rb

Instance Method Summary collapse

Instance Method Details

#job_function(object, method, options = {}, html_options = {}) ⇒ Object

Return select and option tags for the given object and method, using job_functions_for_select to generate the list of option tags.



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/job_function.rb', line 14

def job_function(object, method, options = {},
                                 html_options = {})

  tag = if defined?(ActionView::Helpers::InstanceTag) &&
          ActionView::Helpers::InstanceTag.instance_method(:initialize).arity != 0

          InstanceTag.new(object, method, self, options.delete(:object))
        else
          JobFunction.new(object, method, self, options)
        end

  tag.to_job_function_tag(options, html_options)
end

#job_functions_for_select(selected = nil) ⇒ Object



28
29
30
31
32
33
# File 'lib/job_function.rb', line 28

def job_functions_for_select(selected = nil)
  values = ::JobFunction::LIST


  return options_for_select(values, selected)
end