I would like to use form_for in my project so that I can easily change
the style of many forms at once. However, it seems to me like
FormBuilders only support certain kinds of form elements(!). Surely
there must be a way to add arbitrary labels/form elements to a form.
Let''s say I had a form that looks like:
ID: (plain-text label)
Name: (text field)
Birthdate: (date chooser)
Picture: (picture)
Foo: (custom widget)
How can I use form_for to generate this and still have each row styled
by the FormBuilder of my choice? Do I need to extend each FormBuilder
with all of the methods that I might want to use?
I''ve been using the FormBuilders listed in the Rails Recipes book as
well as the LabeledFormHelper from techno-weenie.net
Speaking of LabeledFormHelper, this is listed in its README file:
-----------
<% form_for :person, @person, :url => { :action => "update"
} do |f| %>
First name: <%= f.text_field :first_name %>
<% end %>
<form action="update">
<p><label for="person_first_name">First
Name</label><br /><input
type="text" id="person_first_name"
name="person[first_name]" /></p>
</form>
---------
Can it really detect the random text "First name:" and wrap it in a
label? Seems unlikely to me.
Thanks,
-Eli Gordon