tap/app/helpers/orders_helper.rb
2014-12-15 18:56:13 +01:00

9 lines
201 B
Ruby

module OrdersHelper
include ActionView::Helpers::TextHelper
def order_to_sentence(order)
order.order_products.map {
|op| pluralize(op.count, op.product.name)
}.to_sentence
end
end