<% row.each do |attachment|
data_ext = attachment.datei.file.extension.downcase %>
<%= link_to attachment.name, edit_thema_attachment_path(@thema,attachment) %>
<% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %>
<%= image_tag attachment.datei.thumb.url %>
<% else %>
<%= image_tag "pdf-logo.jpg" %>
<% end %>
<% if(editor) %>
<% else %>
<%= link_to 'Destroy',[@thema,attachment], method: :delete, data: { confirm: 'Are you sure?' } %>
<% end %>
<% end %>