Forum: Ruby on Rails Rails 2.3.2 nested forms, option_groups etc

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
44a43e7fef8e933e802a7802b4bd3525?d=identicon&s=25 John Small (johnsmall)
on 2009-03-26 17:10
Working in 2.3.2 and working from the examples in Github for nested
forms, this works fine for simple text fields, or simple selects but
option_groups_from_collection_for_select is a bit more complicated.

The js code he's used generates a template to be used for each nested
form, but it does it in the simple example by using a f.select helper.
This will generate the correct html for the new record. But if you're
doing something a bit more complex e.g. using
option_groups_from_collection_for_select then you have to wrap the
options in your own select tag. So how do I get everything in place in
my hand coded <select> and also allow the js to create the right
template?

All comments welcome

Ta

John Small
This topic is locked and can not be replied to.