From 2de388de64f8dae3607623165789fd5f831d90a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81my=20Coutable?= Date: Fri, 10 Dec 2010 16:31:00 +0100 Subject: [PATCH] Added text about the conditions hash that can be passe to PDFKit::Middleware.new --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d5d67296..bfd88cbc 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,16 @@ PDFKit comes with a middleware that allows users to get a PDF view of any page o # options will be passed to PDFKit.new config.middleware.use PDFKit::Middleware, :print_media_type => true +**With conditions to limit routes that can be generated in pdf** + + # conditions can be regexes (either one or an array) + config.middleware.use PDFKit::Middleware, {}, :only => %r[^/public] + config.middleware.use PDFKit::Middleware, {}, :only => [%r[^/invoice], %r[^/public]] + + # conditions can be strings (either one or an array) + config.middleware.use PDFKit::Middleware, {}, :only => '/public' + config.middleware.use PDFKit::Middleware, {}, :only => ['/invoice', '/public'] + ## TODO - add amd64 support in --install-wkhtmltopdf