I’m trying to implement acts_as_rateable to my Beast installation to
give users the option to rate posts (like reddit). I chose
acts_as_rateable as it supposedly easily allows reddit-type voting but
I’m having some problems setting it up and the documentation seems
So far, I’ve added acts_as_rateable to my posts model and I’ve added
this method to my controller:
return unless logged_in?
rateable = @rateable_class.find(params[:id])
# Delete the old ratings for current user
Rating.delete_all([“rateable_type = ? AND rateable_id = ? AND
user_id = ?”, @rateable_class.base_class.to_s, params[:id],
rateable.add_rating Rating.new(:rating => 1, :user_id =>
Is there a way to dynamically update (ajax) the rating in my view
without having to refresh the page? I’ve tried link_to_remote and am
looks like this:
Thanks ahead for the help!