Hi

Has anyone an explanation why the following routing is not working?

ActionController::Routing::Routes.draw do |map|
  map.namespace :admin do |admin|
    admin.connect ':controller/:action/:id'
    admin.connect ':controller/:action/:id.:format'
  end
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end

The following error message ist caused only by “admin.connect
':controller/:action/:id.:format'”.
Route segment ":controller" cannot be optional because it precedes a
required segment. This segment will be required.

Replacing it with the following rule works fine:

  map.connect 'admin/users/:action.:format', { :controller => 'admin/
users' }

Interestingly, the variant without explicit format works fine under
the namespace…

Any idea?

$am

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to