I’m using prawn to generate pdfs, set up ala https://github.com/prawnpdf/prawn/wiki
I’d like to access my routes so I can generate links in my pdfs, but now I’m not in a template like I used to do with prawnto, so I don’t have access to the named routes.
class MyPdf < Prawn::Document
def to_pdf
text root_path
end
end
How can I include my named routes?
You should
include ActionController::UrlWriterAnd if you are trying to use named routes from outside Rails environment, then you should load the environment, but this loading will be slow