I’ve run into a problem upgrading an app to rails 2.0.1. All of this
worked under 1.2.6, but I’m not sure if the problem is caused by a bug
or changed behavior in 2.0.1.
this routing:
map.resources :bands do |t|
t.resources :instruments
t.resources :instruments, :collection => {:review => :get}
end
generates this when i run rake routes
review_band_instruments GET /bands/:band_id/instruments/review
{:action=>“review”, :controller=>“instruments”}
this method
review_band_instruments_path(1)
produces this path
/bands/1/instruments/review
which erroneously generates these parameters:
Parameters: {“action”=>“show”, “id”=>“review”,
“controller”=>“instruments”, “band_id”=>“1”}
and this error message:
ActiveRecord::RecordNotFound (Couldn’t find Source with ID=review AND
(instruments.band_id = 1))
under 1.2, this all worked properly with the following parameters:
Parameters: {“action”=>“review”, “controller”=>“instruments”,
“band_id”=>“1”}
Any help appreciated.