Forum: Ruby on Rails Removing id from show for good

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.
Bao L. (Guest)
on 2006-03-30 08:46
hi guys, anyone know how to do this?

from /recipe/show/1 to /recipe/show/

i have been trying soooo many methods which i feel like a serious noob.

in routes.rb, i tried changing the default connection from
map.connect ':controller/:action/:id'
to
map.connect ':controller/:action/'

or map.connect ':controller/:action/:id', :id=>{/\d+\}
or map.connect ':controller/:action/:id' :requirements=>{ :id=>{/\d+\}}

all failed me miserably...

it either remains the same as /recipe/show/1 or /recipe/show?id=1 or
error handling error....

is it possible to do this in the first place?

Insanity is getting out of hand. help needed urgently.

T-T
François B. (Guest)
on 2006-03-30 11:02
(Received via mailing list)
Hi !

2006/3/29, bao lee <removed_email_address@domain.invalid>:
> hi guys, anyone know how to do this?
>
> from /recipe/show/1 to /recipe/show/

How do you expect the application to know which recipe to show ?

Bye !
This topic is locked and can not be replied to.