So the app I’m working on has things that we refer to with a slug (let’s
pretend they are blog entries). If one has the proper URL of the form
(example) www.mydomain.com/blogthing/display/666, they can enter that in
their browser, and the rails app will dutifully go there and display
blogthing number 666. All is well.
Now suppose somebody is browsing the blogthings and happens upon 666.
He decides to send the URL for blogthing 666 to his buddy, and goes to
the URL box of the browser, prepared to copy it and send it to his
buddy. Low and behold, the URL box in the browser doesn’t say
www.mydomain.com/blogthing/display/666...is just says
This is because the routing for www.mydomain.com/blogthing/display/666
takes the slug off the end and passes the slug as a parameter to the
“blogthing controller’s display action”, which then shows the blogthing
entry in question.
So the pointy haired boss wants this case to result in
“www.mydomain.com/blogthing/display/666” in the browser’s URL box. The
other reason for this is that if one wants to bookmark a particular
blogthing, it needs to have the whole thing in the URL box of the
browser. Maybe not so pointy haired after all.
Is there any way to do this without hacking the Rails internals?
If not, dare I say…how/where would I do this hacking?