Make order_pdf more generally useful

This commit is contained in:
wvengen 2015-04-10 21:30:04 +02:00
parent bc1eb3bc44
commit 379dc86ffa
1 changed files with 8 additions and 6 deletions

View File

@ -10,10 +10,12 @@ module OrdersHelper
# @param order [Order]
# @param document [String] Document to display, one of +groups+, +articles+, +fax+, +matrix+
# @param text [String] Link text
# @param options [Hash] Options passed to +link_to+
# @return [String] Link to order document
# @see OrdersController#show
def order_pdf(order, document, text)
link_to text, order_path(order, document: document, format: :pdf), title: I18n.t('helpers.orders.order_pdf')
def order_pdf(order, document, text, options={})
options = options.merge(title: I18n.t('helpers.orders.order_pdf'))
link_to text, order_path(order, document: document, format: :pdf), options
end
def options_for_suppliers_to_select