$('tr[id=measurement-<%= @measurement.id %>]').nextUntil('tr.measurement') .remove('tr:not(.details)').hide().addBack().first().after( '