This project is archived and is in readonly mode.
Rails-3.0.3 gives Completed 406 Not Acceptable
-
James B. Byrne
Just mouse over the links and you will see the difference in the generated urls.
-
Andrés Mejía
I cannot reproduce this. Can you try to isolate the issue to a minimal application that exhibits the problem? Thanks!
-
James B. Byrne
I will try. The difficulty being that we are about to deploy the next release of our application. So, I might be a little while getting to it.
-
James B. Byrne
I have done a little more investigation and I do not think that I can get things much simpler than this:
Routes as given above.
3.0.3 behaviour ( same as 3.0.2 )
$ rails c Using AdapterExtensions Loading development environment (Rails 3.0.3) ruby-1.8.7-p302 > app.user_roles_path => "/user/roles" ruby-1.8.7-p302 > app.user_roles_path( 1 ) => "/user/roles.1" ruby-1.8.7-p302 > exit3.0.1 behaviour
$ rails c Using AdapterExtensions Loading development environment (Rails 3.0.1) ruby-1.8.7-p302 > app.user_roles_path ActionController::RoutingError: No route matches {:controller=>"user_roles", :action=>"create"} from /home/byrnejb/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:424:in `raise_routing_error' from /home/byrnejb/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:397:in `generate' from /home/byrnejb/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:453:in `generate' from /home/byrnejb/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:481:in `url_for' from /home/byrnejb/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/lib/action_dispatch/routing/url_for.rb:132:in `url_for' from /home/byrnejb/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:195:in `user_roles_path' from (irb):2 ruby-1.8.7-p302 > app.user_roles_path( 1 ) => "/users/1/roles" -
James B. Byrne
I should point out that this behaviour is exhibited after I did the following simplifications:
- The entire route.rb file looks like this:
Proforma::Application.routes.draw do resource :user do resources :roles end resources :users do resources :roles, :controller => 'user_roles' end endThe Gemfile contains only this:
source 'http://rubygems.org' gem "rails", "= 3.0.3" gem 'pg -
James B. Byrne
I generated a new rails-3.0.3 project and added the suspect routes only. The problem is instantly reproducible:
$ rails c Loading development environment (Rails 3.0.3) ruby-1.8.7-p302 > ruby-1.8.7-p302 > app.user_roles_path( 1 ) => "/user/roles.1" -
José Valim
- State changed from new to invalid
- Importance changed from to Low
A conflict of the routes name is happening here. I don't think this is a regression, but actually a fix as routes methods generated first have higher priority than the ones generated later. If you change the routes order, you should get this fixed. The output of
rake routeswill also help you. -
James B. Byrne
Reordering the resources did resolve the problem.