pointy haired boss request - turn off pretty url

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.

/blogthing/display/666 should be accessing the display action, passing 666 as the slug unless you're doing something weird. In which case, I'd stop doing that weird thing.

What you're saying implies that this is a redirect and not a render of that action. Please confirm what you wrote:

1. You request GET /blogthing/display/666

2. You arrive at POST /blogthing/display with params[:slug] = '666'

Rails does no such magic unless you are in fact doing a weird thing.

--Andrew Vit

I'd presume that your not passing the slug as an id, and your passing it as a :slug => object.slug or whatever. Just change that to :id => object.slug(or whatever method it is on the object) this should automatically populate your URL in the :id space, as in :controller/:action/:id and then use params[:id] in your controller....

OR

You could create a named route something like map.restful_name 'blogthing/display/:slug', :controller => controller_name, :action => action_name Your form should then use, :slug(in place of :id) so :slug => object.slug Then you can use params[:slug] in your controller

Does this make sense? Basically in both examples the same thing is happening, the :id/:slug is put into the URL by the form, and then the :id/:slug is pulled out of the URL by the controller, so if you just go straight to the URL the controller still finds the id/slug.

Cam

Also check out the magic routing plugin, it might be suitable for your URLs with meaningful slugs:

http://agilewebdevelopment.com/plugins/magic_routing