This is easy! I just finished a Rails 3 app with devise, so my pain can be your gain. Just include the before_filter
at the beginning of the controllers you want to protect. Let's use the example of a Videos controller:
class VideosController < ApplicationController
before_filter :authenticate_user!
# all your actions go here: index, new, create, etc #
end
You can also pick and choose what actions in the controller are filtered:
class VideosController < ApplicationController
before_filter :authenticate_user!, :only => [:edit, :update, :destroy]
# all your actions go here: index, new, create, etc #
end
Devise gives you the authenticate_user!
method, and redirects for you.