2009/9/25 Dudebot <[email protected]>:
>
> Thanks again, Colin--in item.rb:
>
> belongs_to :category
>
> And in category.rb:
>
> has_many :items
>
> Item has a field category_id which I intended to populate with the
> links from an item to its category.  The field header in the category
> db is where the name of the category is.
>
> Am I setting it up wrong then to have:
>
> <%= f.collection_select :category_id, Category.all, :id, :header,
> {}, :multiple => false %>
>
> in the form?  It does show up as a drop down box with the names
> populated in it.
>

That should be fine as far as I can see, though I don't understand the
extra [] in the html you showed.  One question, you said that it is
not saving the new category id value, are you sure that it is not
saving it, or is it possibly just not displaying it when you come
round next time.  Have a look in the db to see.

Another question, in an earlier post you showed the record being saved
by update_attributes, what are you doing if that fails?  In other
words is the save succeeding?

I am getting to the point where I don't know what is happening I am afraid.

Colin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to