<%= form_with(model: category) do |form| %>
  <% if category.errors.any? %>
    <div style="color: red">
      <h2><%= pluralize(category.errors.count, "error") %> prohibited this category from being saved:</h2>

      <ul>
        <% category.errors.each do |error| %>
          <li><%= error.full_message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div>
    <%= form.label :name, style: "display: block" %>
    <%= form.text_field :name %>
  </div>

  <div>
    <%= form.label :description, style: "display: block" %>
    <%= form.rich_textarea :description %>
  </div>

  <div>
    <%= form.label :image, style: "display: block" %>
    <%= form.file_field :image %>
  </div>

  <div>
    <%= form.submit %>
  </div>
<% end %>
