# Rails 2.3.2 nested forms, option\_groups etc

**URL:** <https://www.ruby-forum.com/t/rails-2-3-2-nested-forms-option-groups-etc/163980>\
**Category:** Rails\
**Created:** [March 26, 2009, 5:10pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-nested-forms-option-groups-etc/163980 "2009-03-26T17:10:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [March 26, 2009, 5:10pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-nested-forms-option-groups-etc/163980/1 "2009-03-26T17:10:18Z")

</div>

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 and also allow the js to create the right  
template?

All comments welcome

Ta

John S.
