# Simple rails example fails

**URL:** <https://www.ruby-forum.com/t/simple-rails-example-fails/153418>\
**Category:** Rails\
**Created:** [November 16, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/simple-rails-example-fails/153418 "2008-11-16T23:18:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doctuh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@Doctuh](https://www.ruby-forum.com/u/Doctuh)\
**Post date:** [November 16, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/simple-rails-example-fails/153418/1 "2008-11-16T23:18:56Z")

</div>

Hi,

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

[http://www.visionmasterdesigns.com/2008/08/tutorial-create-blog-using-ruby-on-rails-2-relationship/2/](http://www.visionmasterdesigns.com/2008/08/tutorial-create-blog-using-ruby-on-rails-2-relationship/2/)

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?

---

<div class="post-metadata">

**Author:** ![Doctuh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@Doctuh](https://www.ruby-forum.com/u/Doctuh)\
**Post date:** [November 17, 2008, 2:37am UTC](https://www.ruby-forum.com/t/simple-rails-example-fails/153418/2 "2008-11-17T02:37:13Z")

</div>

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
