Displaying 1 result from an estimated 1 matches for "yourcustomformbuilder".
2008 Dec 07
0
boolean button helper
...expressive in some situations and better convey to the user that they
are making a mandatory choice. But doing this with radio buttons
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'' ) +...