wazery / ratyrate

:star: A Ruby Gem that wraps the functionality of jQuery Raty library, and provides optional IMDB style rating.
http://ratingmoviestore.herokuapp.com
237 stars 120 forks source link

Average Score and individual Score #103

Open mloayzat opened 8 years ago

mloayzat commented 8 years ago

Hello, new app developer and Github contrbuter here. I love the idea of this gem but had a simple question: I currently have a list of spa services in one page with different columns just as Name, Phone, Address etc and wanted to have a column for rating where each user that registers can see a big star with the avg score and below it have the 5 small stars for them to be able to rate themselves and edit the rating later if they want. I used the following code which appeared to be working but then when I was testing it with a new user I realized that if they haven't rated the place yet they cannot see the average but just the 5 small stars.

Any tips and/or is this possible to do?

<%= rating_for service, "score", imdb_avg: true, disable_after_rate: true %> Score: <%= rating_for service, "score", disable_after_rate: false %>
ckiklas commented 8 years ago

Hey mloayzat,

Can you post the code from your service model please?