madebymade/spree_shipping_matrix

View on GitHub
app/views/spree/admin/shipping_matrix_rules/_form.html.erb

Summary

Maintainability
Test Coverage
<tr>
  <td>
    <%= f.collection_select(:role_id,
                            Spree::Role.all,
                            :id, :name, {},
                            {class: 'select2 fullwidth'}) %>
  </td>
  <td>
    <%= f.number_field(:min_line_item_total,
                       value: number_with_precision(f.object.min_line_item_total,
                                                    precision: 2)) %>
  </td>
  <td>
    <%= f.number_field(:amount,
                       value: number_with_precision(f.object.amount,
                                                    precision: 2)) %>
  </td>
  <td class="actions">
    <% if f.object.persisted? %>
      <a
        id="rule-<%= f.object.id %>"
        href="#remove-<%= f.object.id %>"
        class="fa fa-trash icon_link with-tip no-text js-remove-row"
        data-confirm="<%= Spree.t(:confirm, scope: :shipping_matrix) %>"
        data-row-object-name="<%= f.object_name %>"
        title="<%= Spree.t(:remove) %>"
        >
      </a>
    <% end %>
  </td>
</tr>