<% 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) %> <% if ['application/pdf', 'application/msword', 'text/plain', 'image/tiff'].include?(a.content_type) %> Attachment <% else %> Attachment: <% end %> <%= link_to a.display_filename, attachment_url %>
<% end %>

<% end %>

<%= body %>