Class: ActionView::Helpers::InstanceTag
- Inherits:
-
Object
- Object
- ActionView::Helpers::InstanceTag
- Defined in:
- lib/has_enum/helpers.rb
Instance Method Summary collapse
- #to_radio_button_enum_tag(options = {}) ⇒ Object
- #to_select_enum_tag(options = {}) ⇒ Object
- #values_for_enum_tag ⇒ Object
Instance Method Details
#to_radio_button_enum_tag(options = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/has_enum/helpers.rb', line 15 def ( = {}) values_for_enum_tag.map do |val| = (val.last, ) [, to_label_tag(val.first, :for => .match(/ id="(.*?)"/)[1])] * $/ end.join($/) end |
#to_select_enum_tag(options = {}) ⇒ Object
22 23 24 25 |
# File 'lib/has_enum/helpers.rb', line 22 def to_select_enum_tag( = {}) = .delete(:html) || {} to_select_tag(values_for_enum_tag, , ) end |
#values_for_enum_tag ⇒ Object
27 28 29 |
# File 'lib/has_enum/helpers.rb', line 27 def values_for_enum_tag object.class.values_for_select_tag(method_name) end |