Sha256: 4ddebd1900e471915a6c2f6d611bd47f9c20a56d6bbd0332877e0fcc1ef70901

Contents?: true

Size: 585 Bytes

Versions: 1

Compression:

Stored size: 585 Bytes

Contents

require 'active_support/concern'

module Footnotes
  module RailsFootnotesExtension

    extend ActiveSupport::Concern

    included do
      prepend_before_filter :rails_footnotes_before_filter
      after_filter :rails_footnotes_after_filter
    end

    def rails_footnotes_before_filter
      if Footnotes.enabled?(self)
        Footnotes::Filter.start!(self)
      end
    end

    def rails_footnotes_after_filter
      if Footnotes.enabled?(self)
        filter = Footnotes::Filter.new(self)
        filter.add_footnotes!
        filter.close!(self)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-footnotes-4.1.7 lib/rails-footnotes/extension.rb