On 3 April 2010 04:33, David Zhu <[email protected]> wrote:
> I made a posts scaffold, and a comments scaffold
>
> Now i want to link the two of them together by --
>
>
> Post--
>
> has_many :comments
>
> and comments-
>
> belongs_to :post
>
>
> After that, I have no idea what to do in the controller or form for my
> comments
>
> What do i need to change in the comments controller and form so every
> comment  that gets created is assigned to a post?
>
> Btw, i already have a post_id:integer column in my comments table
>
> I REALLY NEED HELP!! thanks a lot

Can I suggest you work through the rails guides at
http://guides.rubyonrails.org/.  Start with Getting Started and work
through them.

Also an excellent tutorial is being developed at http://www.railstutorial.org/

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