我一直在升级到 Rails 4,并在运行命令“rspec”之后。我收到以下错误:
/Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-4.0.0.rc1/lib/action_dispatch/routing/mapper.rb:1297:in `member': can't use member outside resource(s) scope (ArgumentError)
我已经稍微改变了我的路线文件,但仍然没有工作。如果有人遇到类似的问题并有解决方法,请与我分享。提前致谢!
Dating::Application.routes.draw do
get 'signup' => 'users#new'
get 'login' => 'sessions#new'
get 'logout' => 'sessions#destroy'
get 'edit' => 'users#edit'
get "/profile/:id" => "users#show"
get "profile/:id/settings" => 'users#edit'
get 'settings/:id' => 'users#settings'
resources :sessions
resources :password_resets
resources :galleries
resources :photos
resources :searches
resources :questions do
resources :answers, only: [:new, :create]
end
resources :users do
member do
get :settings
end
end
root to: 'galleries#index'
resources :users do |user|
resources :messages do
collection do
post 'delete_multiple'
get 'settings', on: :member
end
end
end