appirits/comable

View on GitHub
backend/app/views/comable/admin/stocks/_form.slim

Summary

Maintainability
Test Coverage
= error_messages_for @stock

- url = comable.admin_product_stocks_path(@product) if @stock.new_record?
- url ||= comable.admin_stock_path(@stock)

= form_for @stock, url: url do |f|
  .hidden
    = f.submit

  fieldset
    .col-md-3
      legend
        = Comable.t('admin.general')
      .help-block

    .col-md-9
      .form-group
        = f.label :quantity
        = f.text_field :quantity

      .form-group
        = f.label :stock_location_id
        = f.collection_select :stock_location_id, [@stock.stock_location].compact, :id, :name, {}, class: 'select2 ajax', data: { source: comable.admin_stock_locations_path }

      .help-block.text-right
        = link_to Comable.t('admin.remove'), 'javascript: void(0)', class: 'remove-fields'