On Dec 18, 2005, at 9:28 PM, Rick Olson wrote:
Ulysses suggested I take it a step further, and allow you to subclass FormBuilder for your own purposes. I made a simple LabeledFormBuilder that formats your fields like so: <p><label for=""><br /><input ... /></p>
I don't really like the <br /> and the <p> in the html. I suggest to either insert a div around the label or let people style it.
using: <% labeled_form_for :foo, @foo do |f| %> <%= f.text_field :bar %> <% end -%> Having thought about it some more after submitting the final diff, I think this labeled_form_for stuff should be extracted to a plugin to show how to write your own FormBuilders. Who knows, it could be the start of an admin scaffolding plugin?
I generally don't use scaffolding, but I would like to see a text_field_with_label helper I guess.
Manfred _______________________________________________ Rails-core mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-core
