Displaying 1 result from an estimated 1 matches for "rateable_class".
2007 Jun 04
1
acts_as_rateable in Beast
...it up and the documentation seems
outdated.
(http://www.juixe.com/techknow/index.php/2006/07/05/acts-as-rateable-plugin/)
So far, I''ve added acts_as_rateable to my posts model and I''ve added
this method to my controller:
def vote_up
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],
@current_user.id])
rateable.add_rating Rating.new(:rating => 1, :user_id =>
@current_user...