Link to files on test server


I have the follwoing code running locally in development mode and it
works perfectly

<% for document in @documents %>
<%= image_tag( document.extension+“.gif”, { :alt =>
document.extension+" file logo", :class=> “document”} ) %>

<%= document.title %>

<% end %>
<% end %>

the above code basically shows the document type image and a link to the

Ive moved this code to a test server and tried it and i keep getting an
error message object doesnt exist so ive also used the below code and it
doesnt work either, i know the file exists because the if statement
checks to see if this file exists and if it does it shows a link to it:

Whats the bestt way to provide a link to a document as i dont want it to
get mixed up in the routing.