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.

routes with namespace not generating correctly

#2117

my routes.rb:

map.namespace :admin do |admin|

admin.resources :api_keys, :member => { :accept => :put, :deny => :put }

end

using path: accept_admin_api_key_url(api_key.id)

generates incorrect URL: http://localhost:3000/admin/api_...

The above URL gives 'no page found' error.

This URL seems to be correct. http://localhost:3000/admin/api_...

Is this a bug?

Reported by Zac Zheng · March 3rd, 2009 @ 02:15 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to invalid

    accept_admin_api_key_url(api_key.id) should generate http://localhost:3000/admin/api_..., as you say it does. So the route generation here is correct.

    The question is what you're doing to get the 404? If you're just clicking on a link, that won't be handled by this route because you specified the PUT verb.

    Your second URL gets handled by the magic :controller/:action/:id route, which doesn't care what verb you specify.

    If you have some other method that you're trying to go to this URL with a reproducible recognition bug, please submit a new ticket.

    March 11th, 2009 @ 09:56 PM