Clean up OrderArticle#new form and related stuff
This commit is contained in:
parent
baa5f16cfc
commit
01264bc0ac
7 changed files with 13 additions and 6 deletions
|
|
@ -18,11 +18,11 @@ class OrderArticlesController < ApplicationController
|
|||
if @order_article and @order_article.units_to_order == 0
|
||||
@order_article.units_to_order = 1
|
||||
else
|
||||
@order_article = @order.order_articles.build(params[:order_article])
|
||||
end
|
||||
unless @order_article.save
|
||||
render action: :new
|
||||
@order_article = OrderArticle.new(params[:order_article])
|
||||
end
|
||||
@order_article.save!
|
||||
rescue
|
||||
render action: :new
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue