Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

rails 3 beta : named route not work

#4243

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

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

State: invalid
Milestone: none
Assigned to: Yehuda Katz (wycats) Yehuda Katz (wycats)
Importance: none

Activity

  1. Hunter
    Hunter

    Here is the work around:
    map.login '/my/login', :controller => 'users', :action => 'login'

    March 20th, 2010 @ 04:28 PM

  2. Denis Odorcic
    Denis Odorcic

    Try match 'my/login' => 'user#login', :as => 'my/login'

    March 20th, 2010 @ 05:49 PM

  3. Rizwan Reza
    Rizwan Reza
    • State changed from new to invalid

    March 27th, 2010 @ 09:20 AM