search for: label_false

Displaying 1 result from an estimated 1 matches for "label_false".

2008 Dec 07
0
boolean button helper
...tons typically takes 5 lines of html: 3 labels and 2 radio buttons. Here''s a simple boolean button helper that you can put in your custom form builder. class YourCustomFormBuilder < ActionView::Helpers::FormBuilder ... def boolean_buttons_for(method, label_true = "true", label_false = "false" ) @template.content_tag("div", @template.label(@object_name, method, method.to_s.humanize, :class => ''align'' ) + @template.radio_button( @object_name, method, true ) + @template.label( @object_name, method.to_s + "_true&q...