# Change default routing

**URL:** <https://www.ruby-forum.com/t/change-default-routing/188222>\
**Category:** Rails\
**Created:** [May 7, 2010, 11:02pm UTC](https://www.ruby-forum.com/t/change-default-routing/188222 "2010-05-07T23:02:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [May 7, 2010, 11:02pm UTC](https://www.ruby-forum.com/t/change-default-routing/188222/1 "2010-05-07T23:02:31Z")

</div>

Hi,  
I would like to change the default routing system.  
I have a city model and instead of have :model/:controller/:id I would  
like to change it to :model/:controller/:name.

How do I do this in the routes.rb?  
I have this message “Couldn’t find City without an ID”

Greg

---

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [May 8, 2010, 10:19pm UTC](https://www.ruby-forum.com/t/change-default-routing/188222/2 "2010-05-08T22:19:26Z")

</div>

Greg,

If you changed your default route to :model/:controller/:name then  
there’s no place to pass an ID parameter to your controller, hence the  
error message. Best practice would be to map.resources (if you are  
using RESTful controllers, which is also good practice).

Matt
