Part of the solution mentioned here is really appealing. I would like propose an alternate method for handling this where we override the current_ability method in application_controller to make it dynamic depending on the controller being used. From there we can specify the ability to use in each controller. It might look something like this:
./app/abilities
./posts_ability.rb
./comments_ability.rb
./admin_ability.rb
./pictures_ability.rb
./uploads_ability.rb
Then in ./app/controllers/my_controller.rb it would look like this:
class MyController < ApplicationController
authorize_with PostsAbility
end
It could also end up being automatic where the PostsController would use the PostsAbility by default.
In retrospect though, there is one thing to consider. It seems there are two ways to try to scale the abilities. In one way, we might have many "roles" that are allowed to interact with the data in different ways. The other way is that we have many models and need a way to split the logic up there. This approach works well with both of them because you can split the logic out based on the action that is being (or likely to be) taken.
One other thing, we can also use inheritence to pre-load abilities that are co-dependent. If Comment belongs to Post, then CommentsAbility could inherit from PostsAbility to add the needed logic.