Rails 4重定向循环错误

时间:2013-12-21 08:11:53

标签: ruby-on-rails ruby devise ruby-on-rails-4

使用devise,cancan和rolify在我的rails 4.0.2应用程序上设置auth堆栈,并在尝试查看users/sign_inusers/sign_up时收到redirect_loop错误。

有谁知道是什么原因造成的?

我的路线档案

Rails::Application.routes.draw do

  resources :events
  resources :users

  root :to => "home#index"

  devise_for :users, :controllers => {:registrations => "registrations"}

end

1 个答案:

答案 0 :(得分:0)

删除行:resources :users,然后尝试......

Rails::Application.routes.draw do
  resources :events
  #resources :users # comment or remove this line

  root :to => "home#index"

  devise_for :users, :controllers => {:registrations => "registrations"}

end