Sha256: 82b9481dd678d40c2b33084c51114894259f0885c6300b4d492c69987b338116

Contents?: true

Size: 1.57 KB

Versions: 3

Compression:

Stored size: 1.57 KB

Contents

<%= form_for @category,
   url: (@category.persisted? ? help_center.support_category_path(@category) : help_center.support_categories_path),
   html: { data: {behavior: "comment-form"} } do |f| %>
  <% if @category.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@category.errors.count, "error") %> prohibited this support_thread from being saved:</h2>
      <ul>
      <% @category.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <div class="mb-4">
    <%= f.label t('title') %>
    <%= f.text_field :name, placeholder: t('how_do_i'), class: "form-control form-input" %>
  </div>
  <div class="mb-4">
    <%= f.label t('position') %>
    <%= f.text_field :position, type: "number", step: "1", min: "0", class: "form-control form-input" %>
  </div>
  <div class="mb-4">
    <%= f.label t('color') %>
    <%= f.color_field :color, class: "form-control form-input" %>
  </div>
  <div class="mb-4">
    <%= f.label t('title') %>
    <%= f.rich_text_area :description, placeholder: t('how_do_i'), class: "form-control form-input" %>
  </div>
  <div class="flex justify-between mb-4 text-right">
    <% if f.object.new_record? %>
      <%= f.button t('add'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
    <% else %>
      <%= f.button t('update'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
    <% end %>

    <%= link_to "Cancel", :back, class: "btn btn-link" %>
  </div>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
help_center-0.0.8 app/views/help_center/support_categories/_form.html.erb
help_center-0.0.7 app/views/help_center/support_categories/_form.html.erb
help_center-0.0.6 app/views/help_center/support_categories/_form.html.erb