consul/consul

View on GitHub
app/components/admin/tenants/form_component.html.erb

Summary

Maintainability
Test Coverage
<%= form_for [:admin, tenant], html: { class: "tenant-form" } do |f| %>
  <%= render "shared/errors", resource: tenant %>

  <%= f.text_field :name %>

  <fieldset>
    <legend><%= attribute_name(:url) %></legend>
    <div class="radio-and-label">
      <%= f.radio_button :schema_type, :subdomain, label: t("admin.tenants.form.use_subdomain", domain: domain) %>
    </div>
    <div class="radio-and-label">
      <%= f.radio_button :schema_type, :domain, label: t("admin.tenants.form.use_domain") %>
    </div>

    <%= f.text_field :schema, label_options: { data: schema_labels_per_schema_type } %>
  </fieldset>

  <%= f.submit %>
<% end %>