<% @group_order_invoices.each do |group_order_invoice| %> $("#paid_<%= group_order_invoice.id %>").html("<%= escape_javascript(render partial: 'toggle_paid', locals: { group_order_invoice: group_order_invoice }) %>"); <% end %> $("#toggle_all_paid_<%= @order.id %>").html("<%= escape_javascript(render partial: 'toggle_all_paid', locals: { order: @order }) %>");