I have a routes.rb
that looks like this:
resources :restaurants, :shallow => true do
resources :orders do
resources :foods
end
resources :categories do
resources :foods
end
end
something like this in my ability.rb
works,
if user.role? :owner
can :manage, Category, :restaurant => {:user_id => user.id}
...
but deeper nesting appears to be a problem with shallow nesting.
can :manage, Food, :category => {:restaurant => {:user_id => user.id}}
end
Any idea on how to get CanCan to handle nesting that is as deep as the last example?