I'm trying to migrate to Pundit and having a bit of trouble.
I have a user model and a photo model.
User has many photos and photo is a nested resource of user. In my controller I do
@user = User.find(params[:user_id])
@photos = @user.photos
In my cancan ability class I have
can :create, Photo, :user => { :id => user.id }
and in a view I would use
<% if can? :create, @user => Photo %>
anyone know how to correctly do this with Pundit?
Thank you in advance