Just pass view_context to the initializer of the subclass of Prine.
def initialize(quote, view_context) super() @view = view_context end
in the controller, change to:
QuotePdf.new(@quote, view_context)
then in a subclass of Prawn this will work:
@view.number_with_precision(quote.sum)
Giang nguyen
source share