i’m bulding a rails 3 app, i’m using devise for manage the auth logics but i was wonder if there is a helper method to check if the current user owns an object (a record into db) that has an association “has_many”.
example:
User
has_many :reports
i have this situation:
<%= current_user.id == report.user.id ? "Personal Report" : report.user.username %>
is possible to create something like:
<%= owned ? "yes" : "no" %>
thanks
Helper:
Usage: