danimashu/sudamos

View on GitHub
app/views/user/attachments/create.js.erb

Summary

Maintainability
Test Coverage
<% if @attachment.new_record? %>
  alert("Error: <%= j @attachment.errors.full_messages.uniq.join(', ').html_safe %>");
<% else %>
  $("#attachments").append('<%= j render(@attachment) %>');
  $("#<%= dom_id(@attachment) %>").hide();
  $("#<%= dom_id(@attachment) %>").fadeIn();
<% end %>