add_associated_link should take fields_for options for custom form builders

0 views
Skip to first unread message

Pascal Ehlert

unread,
Jun 23, 2008, 8:42:00 AM6/23/08
to attribute_fu
Hi James,

thanks for this amazingly simple, yet so useful, plugin.
When using it with my custom form builder, I experienced one problem,
though.

Unfortunately, the add_associated_link does not have a :fields_for
attribute, so that you cannot
give it a :builder attribute. This results in all newly added fields
being rendered without your builder.

I have thus modified the method slighty: http://pastie.org/220293
I'd like to see these changes in trunk, soon.

fyi, here is how my builder overrides the default methods so that I
don't have to pass the options every time:
http://pastie.org/220314


Cheers

Pascal

James Golick

unread,
Jun 23, 2008, 11:17:18 PM6/23/08
to attrib...@googlegroups.com
Hey Pascal,

You're absolutely right. I just put this in my TODO :).

But, I wanted to mention, as well, that there is an option on ActionView::Base to speicfy a default form builder that will auto override all form_for calls, etc

ActionView::Base.default_form_builder = LabeledFormBuilder

J.
Reply all
Reply to author
Forward
0 new messages