我在 ruby-on-rails 项目中使用设计,before_filter :authenticate_user!, :only => [:show]
当我在 UsersController 中使用它时不起作用:
# ./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