% if params[:action] == 'new' or params[:action] == 'create' %>
<% url = cavy_create_item_section_path %>
<% method = 'post' %>
<% else %>
<% url = cavy_update_item_section_path(@item_section.id) %>
<% method = 'patch' %>
<% end %>
<%= form_for @item_section, url: url, method: method do |f| %>
<% if @item_section.errors.any? %>
<%= "#{pluralize(@item_section.errors.count, "error")} prohibited this item_section from being saved:" %>
<% @item_section.errors.full_messages.each do |msg| %>
-
<%= msg %>
<% end %>
<% end %>
<%= f.label :title, class: 'control-label' %>
<%= f.text_field :title, class: 'form-control' %>
<%= f.submit 'Save', class: 'button success' %>
<% end %>