Hide zero results in matrix pdf.
This commit is contained in:
parent
de1aa2ac38
commit
d62d45e4a4
2 changed files with 8 additions and 2 deletions
|
|
@ -152,7 +152,12 @@ class OrdersController < ApplicationController
|
|||
# Renders the matrix PDF.
|
||||
def matrixPdf
|
||||
@order = Order.find(params[:id])
|
||||
prawnto :filename => "#{Date.today}_#{@order.name}_Matrix.pdf"
|
||||
unless @order.order_articles.ordered.empty?
|
||||
prawnto :filename => "#{Date.today}_#{@order.name}_Matrix.pdf"
|
||||
else
|
||||
flash[:error] = "Es sind keine Artikel bestellt worden."
|
||||
redirect_to @order
|
||||
end
|
||||
end
|
||||
|
||||
# adds a Comment to the Order
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue