Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4236404
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:38:03+00:00 2026-05-21T02:38:03+00:00

Given the Ruby-on-Rails MVC framework, what is the best way to handle a rating

  • 0

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 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:38:04+00:00Added an answer on May 21, 2026 at 2:38 am

    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).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given following Ruby statements: (Read input and store each word in array removing spaces
Given a Python object of any kind, is there an easy way to get
Given a (source) patch file, what's the easiest way to apply this patch on
Context: I am trying to practice BDD in a Ruby on Rails environment using
Im doing Michael Hartl's excellent tutorial series on ruby on rails here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book and
This question is a follow up to this previous question: Ruby on Rails: Custom
Given a specific DateTime value, how do I display relative time, like: 2 hours
Given a select with multiple option's in jQuery. $select = $(<select></select>); $select.append(<option>Jason</option>) //Key =
Given a DateTime representing a person's birthday, how do I calculate their age in
Given an absolute or relative path (in a Unix-like system), I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.