# :index option for form select

**URL:** <https://discuss.rubyonrails.org/t/index-option-for-form-select/31732>\
**Category:** rubyonrails-talk\
**Created:** [July 11, 2008, 7:25pm UTC](https://discuss.rubyonrails.org/t/index-option-for-form-select/31732 "2008-07-11T19:25:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkMT](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@MarkMT](https://discuss.rubyonrails.org/u/MarkMT)\
**Post date:** [July 11, 2008, 7:25pm UTC](https://discuss.rubyonrails.org/t/index-option-for-form-select/31732/1 "2008-07-11T19:25:44Z")

</div>

I've found the :index option to be useful and necessary for form methods when I have a form that contains fields for multiple records, some of which have already been saved previously and some of which are new.

However I ran into a problem today when I was trying to do this with a form that had a pull down select field for each of several records - the :index just wasn't being inserted into the params hash. After much frustration and investigation I finally found the explanation in the api documentation ([http://api.rubyonrails.org/classes/ActionView/](http://api.rubyonrails.org/classes/ActionView/) Helpers/FormOptionsHelper.html) -

"Like the other form helpers, select can accept an :index option to manually set the ID used in the resulting output. Unlike other helpers, select expects this option to be in the html\_options parameter. "

This explains exactly why I was having trouble and the problem is now fixed. But it leaves me with a big question... why??? Why on earth would they put this option in a different method parameter? Is there some logic behind this?
