foodsoft/app/helpers/orders_helper.rb

19 lines
579 B
Ruby
Raw Normal View History

# encoding: utf-8
2009-01-06 11:49:19 +01:00
module OrdersHelper
def update_articles_link(order, text, view)
link_to text, order_path(order, view: view), remote: true
end
def order_pdf(order, document, text)
link_to text, order_path(order, document: document, format: :pdf), title: "PDF erstellen"
2009-01-06 11:49:19 +01:00
end
def options_for_suppliers_to_select
2011-06-10 13:53:51 +02:00
options = [["Lieferantin/Lager auswählen"]]
options += Supplier.all.map {|s| [ s.name, url_for(action: "new", supplier_id: s)] }
options += [["Lager", url_for(action: 'new', supplier_id: 0)]]
2011-06-10 13:53:51 +02:00
options_for_select(options)
end
2009-01-06 11:49:19 +01:00
end