Sha256: 614e40da02ddd038ed864d45546d1b98ec6588a65b36e8be9cd1eb801a240e63

Contents?: true

Size: 831 Bytes

Versions: 4

Compression:

Stored size: 831 Bytes

Contents

require 'wicked_pdf/pdf_helper'
require 'wicked_pdf/wicked_pdf_helper'
require 'wicked_pdf/wicked_pdf_helper/assets'

class WickedPdf
  if defined?(Rails.env)
    class WickedRailtie < Rails::Railtie
      initializer 'wicked_pdf.register', :after => 'remotipart.controller_helper' do |_app|
        ActiveSupport.on_load(:action_controller) do
          if ActionController::Base.respond_to?(:prepend) &&
             Object.method(:new).respond_to?(:super_method)
            ActionController::Base.send :prepend, PdfHelper
          else
            ActionController::Base.send :include, PdfHelper
          end
          ActionView::Base.send :include, WickedPdfHelper::Assets
        end
      end
    end

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

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wicked_pdf-2.1.0 lib/wicked_pdf/railtie.rb
wicked_pdf-2.0.2 lib/wicked_pdf/railtie.rb
wicked_pdf-2.0.1 lib/wicked_pdf/railtie.rb
wicked_pdf-2.0.0 lib/wicked_pdf/railtie.rb