A simple approach could be a helper
that checks for the file extension with some regex or some simple string comparison, then creates a image_tag
based on the type:
def extension_image(file_name)
if file_name.upcase.include?('.PDF')
image_tag 'pdf.png'
elsif file_name.upcase.include?('.JPG')
...
...
end
Then on your view:
<td>
<%= extension_image(File.basename(file)) %>
<%= link_to File.basename(file).upcase, file[/\/.*/] %>
</td>