[Rails] HABTM with multiple select list

Alfonso Ali
2006-06-30T19:20:25Z

Hi,

Inessa Weiner wrote:
>     @title.categories << Category.find(@params[:category_ids])
.
.
.
> Category Mappings:
>
> <% options = options_from_collection_for_select (@categories,
> ''name'',''id'', @category_ids) %>
> <%= select_tag(''categories_ids[]'', options,
{:multiple=>true, :size=>7}) %>
>
> ----
> I am getting error:
> Couldn''t find Category without an ID

I think it should be:
   @title.categories = Category.find(params[:categories_ids]) if
params[:categories_ids]

Regards,
   Ali