Customize URL

in my ruby application I manage a MySQL db.
The url are generated by the classic command line link_to or url_for.

For image I use the command:

<img src="<%= url_for(:action=>"picture", :id=>>" ....

so the URL generated is:


I would like to generate an URL like this one:


Can you help me?

Thank you very much!

thank for your answer but I need to know the answer to my question
because the images of my site load from the db!
Can you help me to write:




instead of the simple:



Google for acts_as_sluggable

Oh wait a minute. Are you wanting the .jpg so the browser will treat
it as an image? If so, you need to be setting the correct content type
on your response. What does your controller action look like? How are
you sending the image?

Look at the Rails doc for "send_data" (or send_file)


Rob Biedenharn

my problem isn't the loading of image from db.
I already use send_data etc... and the browser works properly.
The matter is that the compiling of url of ruby isn't friendly for the
search engine spider because it is written like this:


I would like to customize the url, also those not referring to images,
like this:




The site is

Thank you!

In that case, look at acts_as_sluggable. Or create a route that
includes the picture name.

I had written a site in ruby....but I don't know how to use the
How can I use acts_as_sluggable on my webhosting?

Thank you very much!

But is this way slower than the search by the sample id?

I'm going on solution:

to do other similar modify I have used the routes.rb: 'view/:id/software/:title',

in view.rhtml I'm using:


that generate:


so I can introduce the name of the software separated by "/".
This way will work also for "picture".

The fantastic thing is that routes.rb works also if I write: 'view/:id/software/:title.html',

so the generated url becames:


It's great!