This is my first ROR application, so this is probably a basic question. I'm building a review site where users submit reviews.
I have a User model, a Review model, a Location model, and a Category model. The Category model belongs to the Location model, and I have that the Review model belongs to the User model. User has many reviews and Locations has many categories.
So when a user navigates the site they see a directory of locations (~/locations), clicks on a link to a location, which then displays the Categories for that locations (~/locations/:id/categories). When the user clicks on a category (~/locations/:id/categories/:id) I have a new review link on the page which sends the user to a form to create a new review (~/users/:id/reviews/new).
The problem I'm having is how do I send the category_id and location_id along with the user's review. I need the additional ids to show the reviews for the correct category, As of now, the user goes to ~/users/:id/reviews/new to create their review, which allows me to easily grab the user_id. How do I also get the category_id and location_id?
Any input is appreciated.