Sha256: 862e6a253f5dee48cbd2aeda21a0cf30841e3f49881a5987a66049b941f32da0

Contents?: true

Size: 738 Bytes

Versions: 2

Compression:

Stored size: 738 Bytes

Contents

require 'pdf_helper'
require 'wicked_pdf_helper'

if defined?(Rails)
  if Rails::VERSION::MAJOR == 2

    unless ActionController::Base.instance_methods.include? "render_with_wicked_pdf"
      ActionController::Base.send :include, PdfHelper
    end
    unless ActionView::Base.instance_methods.include? "wicked_pdf_stylesheet_link_tag"
      ActionView::Base.send :include, WickedPdfHelper
    end
    Mime::Type.register 'application/pdf', :pdf

  else

    class WickedRailtie < Rails::Railtie
      initializer "wicked_pdf.register" do |app|
        ActionController::Base.send :include, PdfHelper
        ActionView::Base.send :include, WickedPdfHelper
        Mime::Type.register 'application/pdf', :pdf
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wicked_pdf-0.7.2 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.0 lib/wicked_pdf_railtie.rb