var $modal = $("#<%= dom_id Note.new, dom_id(@releasable) %>")

<% if @note.valid? %>
  $modal.modal("toggle");
  $("tr#<%= dom_id @releasable %>").replaceWith("<%= j render(@releasable) %>");
<% else %>
  $modal.html("<%= j render(partial: "form", locals: { releasable: @releasable, note: @note }) %>")
<% end %>
