Given the Ruby-on-Rails MVC framework, what is the best way to handle a rating api/function.
If I want to give users the ability to rate “stories”, without actually editing them, what would be the best route to take. I don’t want to put the story into edit mode, I just want to grab the story’s ID and add a record in a Ratings table.
Would it be correct just to create a VIEW, in which the Ratings table is open for edit, but the linked stories are just in display mode???
Obviously I’m a beginner, when it comes to MVC and RonR, but I just want to get the proper way of doing this straight in my head 🙂
You would have a ratings model which would store the association between all the ratings and all the stories.
From there you would have a ratings controller that would be there to mainly create a rating(as in a user rates a story).
When a user creates a rating, the request should go to the RatingsController#create.
On the story view page, you would link to the RatingsController#create by passing in the paramater of the story id through the GET paramaters(by using nested resources).