Sha256: 6ec29883af7ec793ef8727bb890cdff171c6e598b2e16c8f9a69ca92ea069b31

Contents?: true

Size: 881 Bytes

Versions: 9

Compression:

Stored size: 881 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
    
  else

    class WickedRailtie < Rails::Railtie
      initializer "wicked_pdf.register" do |app|
        ActionController::Base.send :include, PdfHelper
        if Rails::VERSION::MINOR > 0
          ActionView::Base.send :include, WickedPdfHelper::Assets
        else
          ActionView::Base.send :include, WickedPdfHelper
        end
      end
    end

  end
  
  if Mime::Type.lookup_by_extension(:pdf).nil?
    Mime::Type.register('application/pdf', :pdf)
  end
  
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
wicked_pdf-0.8.0 lib/wicked_pdf_railtie.rb
wicked_pdf_rails_2-0.7.9.1 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.9 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.8 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.7 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.6 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.5 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.4 lib/wicked_pdf_railtie.rb
wicked_pdf-0.7.3 lib/wicked_pdf_railtie.rb