Skip to content

Commit

Permalink
Added text about the conditions hash that can be passe to PDFKit::Mid…
Browse files Browse the repository at this point in the history
…dleware.new
  • Loading branch information
Rémy Coutable committed Dec 10, 2010
1 parent 48f6fef commit 2de388d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -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

Expand Down

0 comments on commit 2de388d

Please sign in to comment.