Consider this in routes.rb
resource :places do
resource :people
get 'search'
end
When I do this in browser:
localhost:3000/places/search
It gives me invalid id for place error.
I'm looking to do this without using a "match"
Consider this in routes.rb
resource :places do
resource :people
get 'search'
end
When I do this in browser:
localhost:3000/places/search
It gives me invalid id for place error.
I'm looking to do this without using a "match"
get
コレクションに適用されることを指定する必要があります。
resource :places do
resource :people
get 'search', :on => :collection
end
詳細については、収集ルートに関するドキュメントを参照してください。
resources :places do
resources :people
get 'search', :on => :collection
end