I have recently created a Rails application to handle parent comments for a company I work for. Each comment is given a score (1-10) by a moderator, I am trying to create a window on an html page that will randomly display a comment in the database as long as it has a score of at least 7. The rails app also has User authorization requirements to be able to view the database of comments.
I know this is possible but I only recently learned Ruby on Rails and am rather new to the html world as well. I am extremely willing to learn something like jquery or ajax if that is what is needed to make this work. I just need some direction so I can get started displaying the comments. Thank you for any help!
Perhaps you could have an action in your CommentsController like this:
Your route in config/routes would look something like this:
And you would access it at:
Make a view at app/views/comments/random_high_rated.html.erb
And in it:
EDIT:
Read through this tutorial and you’ll be able to write your own code in no time!
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book