<% el_id = dom_id(resource, 'list') form_wrap_id = dom_id(resource, 'list_edit') html = %[#{render('form')}].html_safe %> $('#<%= form_wrap_id %>').remove(); $('#<%= el_id %>').after('<%= j html %>'); $('#<%= form_wrap_id %> td:first').attr('colspan', $('#list tr:first th').length); $('#<%= el_id %>').scrollToEl(); $('#<%= form_wrap_id %> form').trigger('admin:form_init'); <%= render 'admin/shared/flash', flash: flash %>