2010-02-07 30 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+/}