intercity/intercity-next

View on GitHub
app/views/domains/create.js.erb

Summary

Maintainability
Test Coverage
<% if @domain.persisted? %>
  $('body').find('.domains tbody').append("<%= j render "domain", domain: @domain %>")
  $('body').find("[data-role~=form] form").trigger("reset")
  $('body').find("[data-role~=empty-table]").addClass("is-hidden")
<% else %>
  $('body').find("[data-role~=form]").html("<%= j render "form" %>");
<% end %>
new FormErrorHandler().reset()
new FormErrorHandler().execute()