tap/app/helpers/orders_helper.rb

10 lines
201 B
Ruby
Raw Normal View History

2014-11-06 18:56:00 +01:00
module OrdersHelper
2014-12-15 18:56:13 +01:00
include ActionView::Helpers::TextHelper
def order_to_sentence(order)
order.order_products.map {
|op| pluralize(op.count, op.product.name)
}.to_sentence
end
2014-11-06 18:56:00 +01:00
end