I am using acts_as_attachment to upload multiple files and it works
great. My problem is when I go to display the files and images. If one
or more files are missing I get an error stating "can't convert nil
into String" what I then tried is the following:
<% if "".blank? %>
<div id="pdf" style="display:none;"></div>
<% else %>
<div id="pdf"><%= link_to image_tag('/images/common/reader_icon.jpg'),
<% end %>
This clears the error but then it also hides the pdf icon for all
other records. How would I go about hiding the pdf icon if there isn't
a file associated with that record but show it if there is a file?
Hope this makes sense and thanks for any help.