I’m using Devise and CanCan to setup authentication and authorization in my app. Now I’m building a Like system that allows users to like/dislike a given model. What is the best way to prevent users from voting on their own content?
Right now I’m checking in the Controller if the content owner is equal to the current user, but it seems to me that this logic should be on the Ability model.
I have no experience in using cancan, but maybe you can use block like this: