# HABTM, select box and array issue

**URL:** <https://www.ruby-forum.com/t/habtm-select-box-and-array-issue/163394>\
**Category:** Rails\
**Created:** [March 19, 2009, 9:48pm UTC](https://www.ruby-forum.com/t/habtm-select-box-and-array-issue/163394 "2009-03-19T21:48:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@Guha](https://www.ruby-forum.com/u/Guha)\
**Post date:** [March 19, 2009, 9:48pm UTC](https://www.ruby-forum.com/t/habtm-select-box-and-array-issue/163394/1 "2009-03-19T21:48:54Z")

</div>

Product model is as follows

```auto
class Product < ActiveRecord::Base
  belongs_to :product_category
  has_and_belongs_to_many :variant_parameters
```

I am displaying a collection of variant parameters for the product.  
Can be more than one selection box. I want to update the same.

I currently have the following selection code

```auto
 <%= collection_select(:product, :variant_parameter_ids,
@product_categories_variants_parameters, :id, :parameter, {:prompt =>
true}) %>
```

I have more than one drop down of variant params associated to the  
product.

How do I specify that I need :variant\_parameter\_ids[] and  
not :variant\_parameter\_ids ?

When I try it I get

```auto
undefined method `[]' for :variant_parameter_ids:Symbol
```

---

<div class="post-metadata">

**Author:** ![Guha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@Guha](https://www.ruby-forum.com/u/Guha)\
**Post date:** [March 19, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/habtm-select-box-and-array-issue/163394/2 "2009-03-19T22:08:50Z")

</div>

Can someone respond please ?
