我的设计设置以前运行良好,但现在,出于某种原因,每当我尝试注册新用户时,它都会尝试调用 users#create 而不是 registrations#create。我认为这一定是我的 routes.rb 文件有问题。我最近向我的应用程序添加了一个新资源“首选项”,因此路由可能很不稳定:
Indexer2::Application.routes.draw do
resources :preferences
get "home/index"
resources :posts
resources :users
devise_for :users, :controllers => {:registrations => 'registrations', :invitations => 'invitations'}, :except => [:show] do
get "/signup" => "devise/registrations#new", :as => 'user_signup'
get '/logout' => 'devise/sessions#destroy', :as => 'user_logout'
get '/login' => "devise/sessions#new", :as => 'user_login'
end
match '/welcome' => 'pages#welcome'
resources :preferences, :except => [:destory, :edit, :create, :new, :index, :show] do
collection do
post "make_feed_preference"
post "change_preference"
end
end
root :to => "home#index"
end