Sha256: 2daa23cd5bcd0afdc1d516faf62139951237387564b9aed1833d5bca5efdecd9

Contents?: true

Size: 562 Bytes

Versions: 7

Compression:

Stored size: 562 Bytes

Contents

require 'active_support/concern'

module Footnotes
  module RailsFootnotesExtension
    extend ActiveSupport::Concern

    included do
      prepend_before_action :rails_footnotes_before_filter
      after_action :rails_footnotes_after_filter
    end

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

    def rails_footnotes_after_filter
      return unless Footnotes.enabled?(self)

      filter = Footnotes::Filter.new(self)
      filter.add_footnotes!
      filter.close!(self)
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
rails-footnotes-7.1.0 lib/rails-footnotes/extension.rb
rails-footnotes-7.0.1 lib/rails-footnotes/extension.rb
rails-footnotes-7.0.0 lib/rails-footnotes/extension.rb
rails-footnotes-5.0.0 lib/rails-footnotes/extension.rb
rails6-footnotes-5.0.2 lib/rails-footnotes/extension.rb
rails6-footnotes-5.0.1 lib/rails-footnotes/extension.rb
rails6-footnotes-5.0.0 lib/rails-footnotes/extension.rb