15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/hstore_radio_buttons/helpers/form_helper.rb', line 15
def hstore_radio_button(method, options = {})
options[:separator] = (options[:separator] ? options[:separator] : "<br />")
methods = HstoreRadioButtons::MethodNamer.new(method)
button_set = "#{object.class.human_attribute_name(methods.getter)}#{options[:separator]}"
object.public_send(methods.options).each do |radio_option|
button_set += @template.hstore_radio_button(@object_name, methods.getter, radio_option, objectify_options(options))
end
content_tag(:div, button_set.html_safe).html_safe
end
|