我在ruby-on-rails项目中使用Devise,当我在UsersController中使用它时before_filter :authenticate_user!, :only => [:show]
无效:
# ./controllers/users_controller.rb
class UsersController < Devise::SessionsController
before_filter :authenticate_user!, :only => [:show]
def show
end
end
# ./config/routes.rb
Notify::Application.routes.draw do
devise_for :users
...
end