diff --git a/README.rdoc b/README.rdoc index 9128092..f571db8 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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 @@ -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.