Module: Prawnto

Defined in:
lib/prawnto.rb,
lib/prawnto/railtie.rb,
lib/prawnto/version.rb,
lib/prawnto/action_view_mixin.rb,
lib/prawnto/template_handlers/dsl.rb,
lib/prawnto/template_handlers/raw.rb,
lib/prawnto/template_handlers/base.rb,
lib/prawnto/action_controller_mixin.rb,
lib/prawnto/template_handler/compile_support.rb

Defined Under Namespace

Modules: ActionControllerMixin, ActionViewMixin, TemplateHandler, TemplateHandlers Classes: Railtie

Constant Summary collapse

VERSION =
'0.1.1'

Class Method Summary collapse

Class Method Details

.enableObject



18
19
20
21
22
23
24
25
# File 'lib/prawnto.rb', line 18

def enable
  ActionController::Base.send :include, Prawnto::ActionControllerMixin
  ActionView::Base.send :include, Prawnto::ActionViewMixin
  Mime::Type.register "application/pdf", :pdf unless Mime::Type.lookup_by_extension(:pdf)
  ActionView::Template.register_template_handler 'prawn', Prawnto::TemplateHandlers::Base
  ActionView::Template.register_template_handler 'prawn_dsl', Prawnto::TemplateHandlers::Dsl
  ActionView::Template.register_template_handler 'prawn_xxx', Prawnto::TemplateHandlers::Raw  
end