Sha256: 071485129cbcec07dc265c0ffc2af14d608114e8308796faa3ceac88f13c1f93

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

<%= form_for(@category, :html => {:id=>"form_category", :class=>"mb-0 form-horizontal", :role => "form", :method => (@category.new_record? ? :post : :put), :remote=>true}) do |f| %>

      <div id="category_form_error">
        <%= @category.errors[:base].to_sentence %>
      </div>

      <div class="form-inputs mb-30 mt-30">

        <% @category.category_type = params[:category_type] if @category.category_type.blank? && params[:category_type] != "All" %>

        <%= theme_form_field(@category, :name) %>

        <%= theme_form_field(@category, :category_type, required: true) %>
        <%= theme_form_field(@category, :one_liner, required: false) %>
        <%= theme_form_field(@category, :description, required: false, html_options: {type: :textarea}) %>
        <%= theme_form_field(@category, :priority, required: false, html_options: {type: :number, style: "width:70px;"}) %>

        <%
          @category.parent_id = params[:parent_id] if params[:parent_id]
          categories = Dhatu::Category.select("id, name").order("name ASC").all
        %>

        <% options = {assoc_collection: categories, required: false, editable: true, assoc_display_method: :name} %>
        <%= theme_form_assoc_group(@category, :parent_id, **options) %>
      </div>

      
    
      <div>
        
        <%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
        
        <%= link_to raw("<i class='fa fa-close mr-5'></i><span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "pull-right ml-10 btn btn-white" %>

      </div>
      <%= clear_tag(10) %>
  </div>

<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dhatu-0.1.5 app/views/dhatu/categories/_form.html.erb