Newbie question on url friendliness


#1

If I wanted to use a friendly url, say, http://www.something.com/my-url,
how would I go about doing that? I can’t define an action my-url, and I
don’t want to clutter my routes up…

Is there a way to do this?


#2

On 6/5/06, Ken K. removed_email_address@domain.invalid wrote:

If I wanted to use a friendly url, say, http://www.something.com/my-url,
how would I go about doing that? I can’t define an action my-url, and I
don’t want to clutter my routes up…

Is there a way to do this?

Yes, by routes. Not sure what you mean by clutter…
Joe


#3

Joe Van D. wrote:

On 6/5/06, Ken K. removed_email_address@domain.invalid wrote:

If I wanted to use a friendly url, say, http://www.something.com/my-url,
how would I go about doing that? I can’t define an action my-url, and I
don’t want to clutter my routes up…

Is there a way to do this?

Yes, by routes. Not sure what you mean by clutter…
Joe

If I have a lot of urls that I would like to do a - instead of a
underscore, wouldn’t that take a lot of lines?


#4

Not sure what you mean, can you please clarify?


#5

I use this:
map.connect ‘:id’, :controller => “pages”, :action => ‘view’

Which allows URLs to be simple like http://www.mysite.com/123

…where 123 is the ID sent to the view action of the pages controller.