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

<% 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-default">Go back</a>
</form>
