Restful AND Pretty Urls


#1

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/

I want

http://www.mysite.com/list_all_my_damn_users

Basically I want the nice little helpers AND pretty urls.


#2

Joe B. wrote:

But what if I wanted my urls to be pretty like

Instead of

http://www.mysite.com/users/

I want

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” (http://railscasts.com/episodes/63-model-name-in-url).

Hope that helps…