https://github.com/mudge/prawn
A minimal Rails 2.3 plugin to provide a template handler for the Prawn PDF library.
https://github.com/mudge/prawn
Last synced: 14 days ago
JSON representation
A minimal Rails 2.3 plugin to provide a template handler for the Prawn PDF library.
- Host: GitHub
- URL: https://github.com/mudge/prawn
- Owner: mudge
- License: mit
- Created: 2009-11-17T15:48:23.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2009-11-30T16:31:02.000Z (over 16 years ago)
- Last Synced: 2026-04-27T12:05:58.941Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: MIT-LICENSE
Awesome Lists containing this project
README
Prawn
=====
A minimal Rails 2.3+ plugin to render `.pdf.prawn` views in Rails using the
Prawn PDF generation library.
Usage
=======
Simply create views ending in `.pdf.prawn` and use the `pdf` variable like so:
pdf.text "Some bold text"
pdf.table [ [1, 2, 3] ]
Then in your controller you can use the standard `respond_to` semantics:
def show
@article = Article.find(params[:id])
respond_to do |format|
format.html # app/views/articles/show.html.erb
format.pdf # app/views/articles/show.pdf.prawn
end
end
Copyright (c) 2009 Paul Mucur, released under the MIT license