I have this in my routes.db, in its entirety
map.resources :posts, :users
map.connect ‘’, :controller => ‘posts’
map.connect ‘users/:page’,
:controller => ‘users’,
:action => ‘index’,
:requirements => { :page => /\d+/}
map.connect ‘users/:id/:page’,
:requirements => { :id => /[a-z]+/i, :page => /\d+/},
:controller => ‘users’,
:action => ‘show’
map.connect ‘:controller/:action/:id.:format’
map.connect ‘:controller/:action/:id’
/users/admin/2 goes to page 2 of the user ‘admin’ as expected. and /
users go to the users index page.
however, /users/2 shows user with id#2, and not page 2 of the users
index. I have in my user model
def to_param
self.name
end
and name is never all digits.
seems like it should work. why doesn’t it? thanks.