nudesign/media_magick

View on GitHub
app/views/_loader.html.erb

Summary

Maintainability
Test Coverage
<li class="attachment" id="<%= attachment.to_param %>" data-id="<%= attachment.to_param %>">
  <% # smell %>
  <% if attachment.file %>
    <% if attachment.class::TYPE == "file" %>
      <%= link_to attachment.filename, attachment.url, download: attachment.filename %>
    <% else %>
      <%= image_tag attachment.url, alt: attachment.filename %>
    <% end %>
  <% end %>

  <%= link_to t('media_magick.remove'), "javascript://", method: "delete", class: "remove btn btn-mini btn-danger", data: { confirmation: t('media_magick.confirm_removal') } %>

  <%= hidden_field_tag "#{model.parameterize}[#{relation.singularize}_ids][]", attachment.id if model && relation %>
</li>