Forum: Ruby on Rails Newbie question on url friendliness

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
539a351d5e60062693df414e9bbb3465?d=identicon&s=25 Ken Kam (kenkam)
on 2006-06-05 23:58
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?
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2006-06-06 00:22
(Received via mailing list)
On 6/5/06, Ken Kam <kenkam@gmail.com> 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
3036c74b9c278dc525af5692080a6d80?d=identicon&s=25 Jeff Ward (Guest)
on 2006-06-06 01:27
(Received via mailing list)
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.
539a351d5e60062693df414e9bbb3465?d=identicon&s=25 Ken Kam (kenkam)
on 2006-06-06 01:42
Joe Van Dyk wrote:
> On 6/5/06, Ken Kam <kenkam@gmail.com> 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?
3036c74b9c278dc525af5692080a6d80?d=identicon&s=25 Jeff Ward (Guest)
on 2006-06-06 02:05
(Received via mailing list)
Not sure what you mean, can you please clarify?
This topic is locked and can not be replied to.