Rails 3: dynamic links in a form
===

I'm building a form where a user can upload a picture. If the form is opened again after saving, the image should be displayed on the screen.

My problem now: how can I make the links to the pictures dynamic?

The link to the pictures right now is something link this:

    <img src="<%=@root_url%>/uploads/clinic/image/1/mamma1.jpg" />
    <img src="<%=@root_url%>/uploads/clinic/image/2/abc.jpg" />
    <img src="<%=@root_url%>/uploads/clinic/image/3/dog.jpg" />

The "1" is the ID of the clinic (it's stored in the database).
The "mamma1.jpg" is the name of the file and it's also stored there.

I would like to have something like:

    <img src="<%=@root_url%>/uploads/clinic/image/:clinic_id/:clinic_image" />

:clinic_id should be the ID column and :clinic_image the image column.

And please keep in mind that I'm pretty new to rails.
Thanks in advance!