Sha256: 06eb22d15b5d1a2a13e99bca46b8bfb39880bd146add7d7b0b01c4de0a60c131
Contents?: true
Size: 1.46 KB
Versions: 3
Compression:
Stored size: 1.46 KB
Contents
= 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 respond_to blocks. == Example class Provider::EstimatesController < Provider::BaseController # You can render PDF templates simply by # using the :pdf option on render templates. def show respond_to do |format| format.html format.pdf do render :pdf => "file_name", :template => "controller/action.pdf.erb", :stylesheets => ["application","prince"], :layout => "pdf", :disposition => "inline" # PDF will be sent inline, means you can load it inside an iFrame or Embed end end end # Alternatively, you can use make_and_send_pdf to # render out a PDF for the action without a # respond_to block. def pdf make_and_send_pdf("file_name") end end == Render Defaults The defaults for the render options are as follows: layout: false template: the template for the current controller/action stylesheets: none disposition: attachment (created PDF file will be sent as download) == Contributors * Gemification and more: Nic Williams == Resources * Copyright (c) 2007-2009 Michael Bleigh and Intridea, Inc., released under the MIT license.
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
princely-1.4.1 | README.rdoc |
princely-1.4.0 | README.rdoc |
princely-1.3.0 | README.rdoc |