Skip to content

Commit

Permalink
Added instructions to install in a Rails 3 app.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Preston committed Sep 14, 2011
1 parent 52e0fe6 commit 4003fd0
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
= Princely

Princely is a simple wrapper for the Prince XML PDF generation library
(http://www.princexml.com). The plugin will also automatically registers
the PDF MimeType so that you can use pdf as a format in controller
Princely is a simple wrapper for the Prince XML PDF generation library
(http://www.princexml.com). The plugin will also automatically registers
the PDF MimeType so that you can use pdf as a format in controller
respond_to blocks.

== Rails 3 Install

Add to your Gemfile:

gem 'princely'

Run:

bundle install

And create an initializer in config/initializers/princely.rb:

require 'princely/rails'

== Example

class Provider::EstimatesController < Provider::BaseController
Expand All @@ -14,14 +28,14 @@ respond_to blocks.
respond_to do |format|
format.html
format.pdf do
render :pdf => "file_name",
render :pdf => "file_name",
:template => "controller/action.pdf.erb",
:stylesheets => ["application","prince"]
:layout => "pdf"
end
end
end

# Alternatively, you can use make_and_send_pdf to
# render out a PDF for the action without a
# respond_to block.
Expand Down

0 comments on commit 4003fd0

Please sign in to comment.