:的authenticate_user!功能不起作用

时间:2013-10-28 15:19:32

标签: ruby-on-rails ruby devise

我在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

0 个答案:

没有答案