Module: GroupOrderArticlesHelper

Defined in:
app/helpers/group_order_articles_helper.rb

Instance Method Summary collapse

Instance Method Details

#group_order_article_edit_result(goa) ⇒ Object

return an edit field for a GroupOrderArticle result



3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/group_order_articles_helper.rb', line 3

def group_order_article_edit_result(goa)
  result = number_with_precision goa.result, strip_insignificant_zeros: true
  if goa.group_order.order.finished? && current_user.role_finance?
    simple_form_for goa, remote: true, html: { 'data-submit-onchange' => 'changed', class: 'delta-input' } do |f|
      f.input_field :result, as: :delta, class: 'input-nano', data: { min: 0 }, id: "r_#{goa.id}", value: result
    end
  else
    result
  end
end