我的 routes.db 文件中有这段代码:
resources :users do
member do
get :following, :followers
end
end
我得到了错误:
can't use member outside resource(s) scope (ArgumentError)
我该如何解决?
更新:这是我的 routes.db 文件的所有代码:
SampleApp::Application.routes.draw do
get "sessions/new"
resources :users
member do
get :following, :followers
end
resources :sessions, :only => [:new, :create, :destroy]
resources :microposts, :only => [:create, :destroy]
resources :relationships, :only => [:create, :destroy]
match '/signup', :to => 'users#new'
match '/signin', :to => 'sessions#new'
match '/signout', :to => 'sessions#destroy'
match '/contact', :to => 'pages#contact'
match '/about', :to => 'pages#about'
match '/help', :to => 'pages#help'
root :to => 'pages#home'