0

最近deviseをインストールしました(restful認証から移行しました)。サイトを確認しようとすると、次のエラーが表示No route matches [GET] "/"されました。このエラーは、試したすべてのURLで発生しました。ここに私のレーキルートデータがあります

   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 

他に何か必要な場合はお知らせください。事前にどうもありがとうございました

4

2 に答える 2

3

解決策はサーバーの再起動でした。どうやらDeviseはルーティングに影響を与えるため、これはセットアップ後に行う必要があります。

于 2013-05-28T13:24:23.227 に答える
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

于 2013-05-23T21:45:53.073 に答える