<% if not attachments.nil? and attachments.size > 0 %>

<% attachments.each do |a| %> <% attachment_url = get_attachment_url(:id => incoming_message.info_request_id, :incoming_message_id => incoming_message.id, :part => a.url_part_number, :file_name => a.display_filename) %> <% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png" full_filename = File.join(File.dirname(__FILE__), "../../../public/images", img_filename) if File.exist?(full_filename) %> Attachment <% else %> Attachment: <% end %> <%= link_to a.display_filename, attachment_url %>
<% end %>

<% end %>

<%= body %>