Forum: Ruby on Rails HABTM, select box and array issue

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.
Guha (Guest)
on 2009-03-19 22:48
(Received via mailing list)
Product model is as follows
[code]
class Product < ActiveRecord::Base
  belongs_to :product_category
  has_and_belongs_to_many  :variant_parameters
[/code]

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
[code]
 <%= collection_select(:product, :variant_parameter_ids,
@product_categories_variants_parameters, :id, :parameter, {:prompt =>
true}) %>
[/code]

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
[code]undefined method `[]' for :variant_parameter_ids:Symbol[/code]
Guha (Guest)
on 2009-03-19 23:08
(Received via mailing list)
Can someone respond please ?
This topic is locked and can not be replied to.