<%= form_with model: @category, url: @category.persisted? ? update_category_path : categories_path, method: :post do |f| %>
  <div class="boxline">
    <%= f.label :category, 'Name:', class: 'required' %>
    <%= f.text_field :category  %>
  </div>

  <div class="boxline">
    <%= f.submit @category.persisted? ? 'Update Category' : 'Create Category' %>
  </div>
<% end %>
