<% if @resource.errors.present? %> <% else %> var formContent = "<%= j render template: 'simple_admin/admin/system/entities/entity_fields/edit', locals: { entity_field: @resource } %>"; var fieldPresentation = '<%= @resource.presentation %>'; if(fieldPresentation == 'collection') { $('#index-fields .content').remove(); $('#index-fields').append(formContent); $( "#tabs" ).tabs( "option", "active", 0); } else if (fieldPresentation == 'form') { $('#form-fields .content').remove(); $('#form-fields').append(formContent); $( "#tabs" ).tabs( "option", "active", 1); } <% end %>