diff --git a/app/controllers/order_articles_controller.rb b/app/controllers/order_articles_controller.rb index f42844e1..e9b3321b 100644 --- a/app/controllers/order_articles_controller.rb +++ b/app/controllers/order_articles_controller.rb @@ -18,7 +18,7 @@ class OrderArticlesController < ApplicationController if @order_article and @order_article.units_to_order == 0 @order_article.units_to_order = 1 # FIXME: this is ugly if used in the receive form else - @order_article = OrderArticle.new(params[:order_article]) + @order_article = @order.order_articles.build(params[:order_article]) end @order_article.save! rescue diff --git a/app/views/order_articles/_new.html.haml b/app/views/order_articles/_new.html.haml index 335c7a16..c0d501ab 100644 --- a/app/views/order_articles/_new.html.haml +++ b/app/views/order_articles/_new.html.haml @@ -1,5 +1,4 @@ = simple_form_for [@order, @order_article], remote: true do |form| - = form.association :order, as: :hidden .modal-header = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} %h3= t '.title'