Link to files on test server

Hi,

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

<% for document in @documents %>
<%if
File.exist?(RAILS_ROOT+"/public/Documents/document/document/"+document.id.to_s+"/"+document.name)
%>
<%= 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
document.

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.

JB

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs