Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (31 sloc) 0.976 kb
module Footnotes
mattr_accessor :before_hooks
@@before_hooks = []
mattr_accessor :after_hooks
@@after_hooks = []
def self.before(&block)
@@before_hooks << block
end
def self.after(&block)
@@after_hooks << block
end
# The footnotes are applied by default to all actions. You can change this
# behavior commenting the after_filter line below and putting it in Your
# application. Then you can cherrypick in which actions it will appear.
#
module RailsFootnotesExtension
def self.included(base)
base.prepend_before_filter Footnotes::BeforeFilter
base.after_filter Footnotes::AfterFilter
end
end
def self.run!
require 'rails-footnotes/footnotes'
require 'rails-footnotes/backtracer'
Dir[File.join(File.dirname(__FILE__), 'rails-footnotes', 'notes', '*.rb')].each { |note| require note }
ActionController::Base.send(:include, RailsFootnotesExtension)
end
def self.setup
yield self
end
end
Jump to Line
Something went wrong with that request. Please try again.