Rewriting FormBuilder


#1

Hi,

I want to extend formbuilder to make it output a lable (I know about
labeled_form_helper made by technoweenie), my own formating, and a
couple of extra tags inside the form attribute. I was easily able to
extend form_remote_to. But when I continue to adjust the way elements
are handled I don’t know how to continue. I can’t find the method
text_field thats should is available in FormBuilder. I only see a 2
methods and a few other methods (form_options and date selectors) in
other files.

I have looked at labeled_form_helper, but it doesn’t work (I use
EdgeRails). So I though of making my own formbuilder, but I can’t find
how things like text_field methods for formbuilder are created…

thnx,

Abdur-Rahman


#2

OMG, I am soooo stupid, didn’t read the following line correct
(FormHelper.instance_methods - [ :check_box, :radio_button ]).each do
|selector|

oeps :slight_smile:


#3

I have looked at labeled_form_helper, but it doesn’t work (I use
EdgeRails). So I though of making my own formbuilder, but I can’t find
how things like text_field methods for formbuilder are created…

It doesn’t work because there are a few minor patches that need to be
made for it. See the latest patch on #3268
(http://dev.rubyonrails.org/attachment/ticket/3268/form_for.diff).
Basically, I need the ability to pass my own FormBuilder class to the
*_for methods.

Also, (FormHelper.instance_methods - [ :check_box, :radio_button ])
didn’t seem to work for me. The method names were strings, so I
needed - %w( check_box radio_button ) instead.

rick
http://techno-weenie.net