Module: ActionView::Helpers::FormOptionsHelper
- Defined in:
- lib/job_function.rb
Instance Method Summary collapse
-
#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.
- #job_functions_for_select(selected = nil) ⇒ Object
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, = {}, = {}) tag = if defined?(ActionView::Helpers::InstanceTag) && ActionView::Helpers::InstanceTag.instance_method(:initialize).arity != 0 InstanceTag.new(object, method, self, .delete(:object)) else JobFunction.new(object, method, self, ) end tag.to_job_function_tag(, ) 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 (values, selected) end |