Forum: Ruby on Rails Simple rails example fails

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.
Ed146e2608af4e6d6da65be145039cd9?d=identicon&s=25 Doctuh (Guest)
on 2008-11-16 23:18
(Received via mailing list)
Hi,

I am a Rails newb. Am using an online tutorial to learn the rails.

http://www.visionmasterdesigns.com/2008/08/tutoria...

It is about creating a simple blog. I have generated the scaffolding
for the categories table and the posts table following the
instructions. I expect posts to infer that category_id is a foreign
key to the categories table and to therefore generate a dropdown list.
However I am getting an textfield when i hit the new post page.
(category_id is assigned 0 whenever I create a new post). I am very
much a newb at rails, am I missing something obvious here?
4b0889adddec0b9bae5435e0c233b1e3?d=identicon&s=25 Davo (Guest)
on 2008-11-17 02:37
(Received via mailing list)
Hi There,

Not familiar with this tutorial ( there is a fair bit of criticism in
the comments ! )

But have you followed the code in the view to add the comments drop
down ?  ( third page of tutorial )
In your post you are sort of suggesting this should happen
automatically because of the relationship, but this is not the case.

HTH Dave
This topic is locked and can not be replied to.