我最近安装了devise(从restful授权迁移),当我尝试检查网站时,我收到以下错误No route matches [GET] "/"
,我尝试的每个网址都出现此错误。
这是我的佣金路线数据
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
session POST /session(.:format) sessions#create
new_session GET /session/new(.:format) sessions#new
DELETE /session(.:format) sessions#destroy
signup /signup(.:format) users#new
register /register(.:format) users#create
login /login(.:format) sessions#new
logout /logout(.:format) sessions#destroy
activate /activate/:activation_code(.:format) users#activate {:activation_code=>nil}
#more routing
这是我的路线档案
dminStagingPuzzleflowUs::Application.routes.draw do
devise_for :users
#resources :users
resource :session, :only => [:new, :create, :destroy]
match 'signup' => 'users#new', :as => :signup
match 'register' => 'users#create', :as => :register
match 'login' => 'sessions#new', :as => :login
match 'logout' => 'sessions#destroy', :as => :logout
match '/activate/:activation_code' => 'users#activate', :as => :activate, :activation_code => nil
#The priority is based upon order of creation:
# first created -> highest priority.
#resource :sessions
resources :support_issues
#other resources
match '' => 'home#index', :as => :home
match ':controller(/:action(/:id))'
root to: 'home#index'
end
如果您还有其他需要,请告诉我。非常感谢您提前
答案 0 :(得分:3)
解决方案是服务器重启。显然,由于Devise会影响路由,所以应该在设置之后完成。
答案 1 :(得分:1)
在routes.rb
dminStagingPuzzleflowUs::Application.routes.draw do
devise_for :users
resources :sessions, :only => [:new, :create, :destroy]
devise_scope :user do
match 'signup' => 'users#new', :as => :signup
match 'register' => 'users#create', :as => :register
match 'login' => 'sessions#new', :as => :login
match 'logout' => 'sessions#destroy', :as => :logout
end
match '/activate/:activation_code' => 'users#activate', :as => :activate, :activation_code => nil
#The priority is based upon order of creation:
# first created -> highest priority.
#resource :sessions
resources :support_issues
#other resources
root to: 'home#index'
end
并运行rake routes