- content_for :javascript do :javascript $(function() { // Subscribe to database changes. // See publish/subscribe design pattern in /doc. $(document).on('OrderArticle#update', function(e) { $.ajax({ url: '#{receive_on_order_article_update_order_path(@order)}', type: 'get', data: {order_article_id: e.order_article_id}, contentType: 'application/json; charset=UTF-8' }); }); $(document).on('OrderArticle#create', function(e) { $.ajax({ url: '#{receive_on_order_article_create_order_path(@order)}', type: 'get', data: {order_article_id: e.order_article_id}, contentType: 'application/json; charset=UTF-8' }); }); }); - title "Receiving #{@order.name}" = form_tag(receive_order_path(@order)) do %section#results = render 'edit_amounts' .form-actions .pull-left Surplus to = label_tag :rest_to_tolerance, class: 'inline' do = check_box_tag :rest_to_tolerance, 1, true member tolerance, %span{style: 'color: grey'} and = label_tag :rest_to_stock, class: 'inline' do = check_box_tag :rest_to_stock, 1, false, disabled: true stock .pull-right = submit_tag t('.submit'), class: 'btn btn-primary' = link_to t('ui.or_cancel'), order_path(@order) %p= link_to_top