ruby on rails - uninitialized constant error using PDFKit -


in rails app, trying generate pdf html , trying use pdfkit , wkhtmltopdf. trying start simplest code like:

kit = pdfkit.new("<p>this text.</p>") pdf = kit.to_file "/home/user/test.pdf" 

but ending following error:

uninitialized constant testcontroller::pdfkit 

testcontroller controller name. fyi, using fedora12 , rails 2.2.

need help. there?

you add pdf mime type app:

open config/initializer/mime_types.rb , add code :

mime::type.register "application/pdf", :pdf

hope helps you.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -