2010-02-07 99 views

回答

2
map.connect ':id', :controller => :your_controller, :action => :show 
0

我假设你的意思是你要像http://example.com/123一个URL来加载http://example.com/mymodel/123。如果是这种情况,请将其放置在路线末端:

map.mymodel_id '/:id', :controller => 'mymodels', :action => 'show', :requirements => { :id => /\d+/}