SEO-friendly urls: Replacing the '-' with '%20'

Assuming I'm reading you correctly -- which appears to be that you want a recipe called 'Rice and Cheese' to become a url of '/recipes/ rice-and-cheese' -- then you want something like the PermalinkFu plugin ( http://svn.techno-weenie.net/projects/plugins/permalink_fu ) by Rick Olsen.

With that you can add (to the Recipe model):

has_permalink :name

and

def to_param; permalink; end

Then add a permalink column with a migration and replace the Recipe.find(params[:id]) with Recipe.find_by_permalink(params[:id]) in your RecipeController.

PermalinkFu takes care of converting all the spaces to dashes, as well as removing other non-word characters and also does a UTF-8 to ascii translation, so your creme brulée recipe would have a permalink of / recipes/creme-brulee.

Alternately, assuming that you meant query literally -- or if permalink_fu is too much, then yes. The way to handle it would be in the Controller or Model rather than in the routes. Probably the easiest way is to call split("-") on the params[:id] (or whatever your route supplies) and then do an appropriate find from there.

Regards, Jon