From a384532619881ce721d685d8ee0be5af3d056c29 Mon Sep 17 00:00:00 2001 From: Julius Date: Wed, 1 Jan 2014 16:54:49 +0100 Subject: [PATCH] Revert some changes of 20adce8a4e2d32548e7d7016dace250dd3e2eb9b --- app/controllers/order_articles_controller.rb | 2 +- app/views/order_articles/_new.html.haml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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'