(コードスクールのオンラインコース、ゼロからのレールアプリパート1の演習を行っています)
これが私のroutes.rb
resources :destinations, only: :index
resources :trips do
resources :destinations
end
そのrake routes結果、次の 2 つのルートが同じアクションに移動します。
Prefix Verb URI Pattern Controller#Action
destinations GET /destinations(.:format) destinations#index
trip_destinations GET /trips/:trip_id/destinations(.:format) destinations#index
に一致させる、つまりにリダイレクトしたいのtrip_destinationsですtrip#showが/trips/:id、ハードコードするroutes.rbか、リダイレクトを追加するなどの解決策がありdestination#indexます。どちらの方がよいですか?このタスクを達成するためのベスト プラクティスはありますか?