Why you don't you the devise helper for this? `before_filter :authenticate_user!` you also can specify the action for it.