This project is archived and is in readonly mode.

#4243 ✓invalid
Hunter

rails 3 beta : named route not work

Reported by Hunter | March 20th, 2010 @ 03:44 PM

when set a named route in config/routes.rb

G0::Application.routes.draw do |map|
resources :users match 'my/login' => 'user#login'

.....

end

use:rake routes ,there was show route is there:

GET /my/login {:controller=>"user", :action=>"login
"}

but when launch server, go to http://localhost:3000/my/login
it will tell you :
No route matches "/my/login"

then I use function test in users_controller_test.rb

1) Error: test_should_route_to_user_login(UsersControllerTest):
ActionController::RoutingError: No route matches "/my/login"

C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch

/routing/route_set.rb:441:in recognize_path'

C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch

/testing/assertions/routing.rb:177:in recognized_request_for'

C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch

/testing/assertions/routing.rb:49:in assert_recognizes'

C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch

/testing/assertions/routing.rb:117:in assert_routing'

test/functional/users_controller_test.rb:53:in `block in <class:UsersControl

lerTest>'

I use windows/netbeans development env, and not an experts on rails, not sure whether is really bug ?

Brs

Hunter

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages