jonsteenbergen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-31 23:31 UTC
another question about acts_as_rateable
I''ve been trying to add some rating capabilities to a site I''m working on, I''ve been following a few tutorials (one being http:// www.juixe.com/techknow/index.php/2006/07/05/acts-as-rateable-plugin/) and I keep seeing something that''s confusing me. ---- from the tute : (in my ratings controller) post = Post.find(params[:id]) post.add_rating Rating.new(:rating => 2) If I place this in my code and update to match my models in my logs I see the error - undefined method `add_rating'' Looking through the acts_as_rateable documentation I''m not seeing that method either. If I alter the code to use the rate method instead of add_rating: (in my ratings controller) post = Post.find(params[:id]) post.rate(:rating => 2) It works and updates the db table and changes that posts rating. The issue with my workaround is that it is overwriting the value - so each posts rating is only whatever was last added. Has anyone run into this? How would I get the add_rating method, also I''ve just noticed that my Model ends up with a rating, but not ratings? Anybody run into these issues, any pointers on how to get this running? thanks in advance! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---