<% if @measurement.destroyed? %> $('tr[id=measurement-<%= @measurement.id %>]').nextUntil('tr.primary').addBack().remove(); <% end %>