views:

19

answers:

1

In my Rails application I have a Forum with many Topics. From the Forum's, "show" page I have a list of Topics with a link to create a new Topic. My goal is to make sure that when creating the new Topic I have the ID of the Forum when I get to the Topic's "create" method. Right now I'm thinking I'd have to create a hidden field on the Topic's "new" page and set the hidden field to the Forum's ID. I was wondering if there is a better, cleaner way.

Thank you for looking!

+1  A: 

Nested resources are the way to go for this, so you nest the Topic resource within the Forum resource. Take a look at these tutorials:

John Topley
Awesome awesome awesome. Thank you much!
jklina