Closed brousalis closed 12 years ago
you mean the :show_user_rating updates itself with the average? It should stay with the user vote.
Sorry, not even sure my original issue is in english. Damn late nights.
And yeah, it doesn't seem to stay with the user vote. I figured out my issue. Following solutions provided on https://github.com/edgarjs/ajaxful-rating/issues/56 to figure the rest out. Nothing wrong with gem :) Just the logic behind what I was trying to do.
I ended up doing this in rate.js.erb:
$("#rates #<%= @guide.wrapper_dom_id(params) %>").html("<%= escape_javascript(ratings_for(@guide, params.merge(:wrap => false))) %>");
$("#average #<%= @guide.wrapper_dom_id(params) %>").html("<%= escape_javascript(ratings_for(@guide, params.merge(:show_user_rating => false, :force_static => true, :wrap => false))) %>");
Worked like a charm :)
When I do something like
The ratings match each other after you vote with the user rating, since the user rating updates itself to the average rating. Is there anyway to turn this off so I can put the average rating on the same view as the voting?
Thanks!