<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="/admin">Admin</a></li>
    <li class="breadcrumb-item">
      <i class="fa fa-<%= current_model_info.icon %>"></i>
      <a href=".."><%= current_model_name.capitalize %></a>
    </li class="breadcrumb-item">
    <li class="breadcrumb-item active"><%= object.to_str %></li>
  </ol>
</nav>

<% if defined?(validation_error) %>
  <div class="alert alert-danger" role="alert">
    <%= validation_error %>
  </div>
<% end %>

<form method="POST">
  <% fields.each do |f| %>
    <%
    if select_fields.include?(f)
      template = :"admin/select_field"
    else
      template = "admin/#{object.class.columns_hash[f.to_s]&.type || :string}_field".to_sym
    end
    %>
    <%== erb(template, locals: {name: f, value: format(f, object.send(f)), disabled: read_only_fields.include?(f)}) %>
  <% end %>
  <% if fields != read_only_fields %>
    <input type="submit" class="btn btn-primary" value="Save"/>
  <% end %>
    <a href=".." class="btn btn-secondary">Go back</a>
</form>
