Sha256: 3f53154a18e0471e0fa808a02c573c500e4f1aa8e80ac2291585f723b42f2fd5

Contents?: true

Size: 573 Bytes

Versions: 10

Compression:

Stored size: 573 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?
        Footnotes::Filter.start!(self)
      end
    end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails-footnotes-4.1.6 lib/rails-footnotes/extension.rb
rails-footnotes-4.1.5 lib/rails-footnotes/extension.rb
rails-footnotes-4.1.4 lib/rails-footnotes/extension.rb
rails-footnotes-4.1.3 lib/rails-footnotes/extension.rb
rails-footnotes-4.1.2 lib/rails-footnotes/extension.rb
rails-footnotes-4.1.1 lib/rails-footnotes/extension.rb
rails-footnotes-4.1.0 lib/rails-footnotes/extension.rb
rails-footnotes-4.0.2 lib/rails-footnotes/extension.rb
rails-footnotes-4.0.1 lib/rails-footnotes/extension.rb
rails-footnotes-4.0.0 lib/rails-footnotes/extension.rb