设计重定向到sign_in页面无缘无故

时间:2011-08-13 12:55:12

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

我在使用ruby 1.8.7的rails 3.0.9项目中使用最新的devise gem,我遇到了一个小问题。

有时当我尝试加载主页或任何面向公众的页面时(无论控制器是否需要授权),它似乎都会呈现并重定向到登录页面。

这是否有解决方法?

更新

刚刚在生产中发生......

Started GET "/posts/knee-up-back-side-balance-lunge" for IP at Sun Aug 14 08:58:03 -0500 2011
  Processing by PostsController#show as HTML
  Parameters: {"id"=>"knee-up-back-side-balance-lunge"}
Rendered posts/show.html.erb within layouts/application (106.7ms)
Completed   in 119ms


Started GET "/admins/sign_in" for IP at Sun Aug 14 08:58:03 -0500 2011
  Processing by Devise::SessionsController#new as HTML
Rendered devise/shared/_links.erb (1.0ms)
Rendered partials/_flash.html.erb (0.1ms)
Rendered partials/_sidebaradverts.html.erb (0.1ms)
Rendered partials/_paypaldonate.html.erb (0.6ms)
Rendered devise/sessions/new.html.erb within layouts/application (165.9ms)
Completed 200 OK in 184ms (Views: 179.0ms | ActiveRecord: 20.6ms)

就像我说的那样,不是很有帮助:(

但如果我重新加载原始页面,它将不会转到“/ admins / sign_in”控制器。 它有点烦人,因为这有时也会发生在googlebot上,我最终会遇到抓取错误。

更新:包含routes.rb文件

MyApp::Application.routes.draw do
  devise_for :admins
  devise_for :accounts
  match "/oauth/create", :to => "oauth#create", :via => "get", :as => "oauth_callback"
  resources :oauth
  resources :movies, :collection => { :import => :get }
  resources :posts
  match 'admin' => 'admin#index'
  root :to => 'index#index'
end

0 个答案:

没有答案