# Restful AND Pretty Urls

**URL:** <https://www.ruby-forum.com/t/restful-and-pretty-urls/152823>\
**Category:** Rails\
**Created:** [November 7, 2008, 7:35pm UTC](https://www.ruby-forum.com/t/restful-and-pretty-urls/152823 "2008-11-07T19:35:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe-black](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@joe-black](https://www.ruby-forum.com/u/joe-black)\
**Post date:** [November 7, 2008, 7:35pm UTC](https://www.ruby-forum.com/t/restful-and-pretty-urls/152823/1 "2008-11-07T19:35:25Z")

</div>

Is there anyway to have restful AND pretty urls?

For example:

map.resources :users

Would give us nice little helpers  
users\_url  
new\_user\_url  
edit\_user\_url(@user)

etc.

But what if I wanted my urls to be pretty like

Instead of

[http://www.mysite.com/users/](http://www.mysite.com/users/)

I want

[http://www.mysite.com/list\_all\_my\_damn\_users](http://www.mysite.com/list_all_my_damn_users)

Basically I want the nice little helpers AND pretty urls.

---

<div class="post-metadata">

**Author:** ![joe-black](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@joe-black](https://www.ruby-forum.com/u/joe-black)\
**Post date:** [November 7, 2008, 7:52pm UTC](https://www.ruby-forum.com/t/restful-and-pretty-urls/152823/2 "2008-11-07T19:52:02Z")

</div>

Joe B. wrote:

> But what if I wanted my urls to be pretty like
> 
> Instead of
> 
> [http://www.mysite.com/users/](http://www.mysite.com/users/)
> 
> I want
> 
> [http://www.mysite.com/list\_all\_my\_damn\_users](http://www.mysite.com/list_all_my_damn_users)
> 
> Basically I want the nice little helpers AND pretty urls.

Let me start out by saying that I actually think your “pretty” url is  
uglier than the “ugly” url… (: Anyway, I don’t think Rails explicitly  
provides the possibility to completely redefine the look and feel of  
urls (unless you’ld use map.connect manually that doesn’t provide any  
helper methods), but you can rid of the id’s by using the to\_param  
method in your ActiveRecord models as described in Railscasts #63 “Model  
Name in URL” ([#63 Model Name in URL - RailsCasts](http://railscasts.com/episodes/63-model-name-in-url)).

Hope that helps…
