Sha256: 738f03ffaf0b3a493e087e37e1f37649855e42a783dd92dd92b535cef9ae9952
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
module Footnotes class Railtie < ::Rails::Railtie config.before_configuration do if ::Rails.env.development? require 'rails-footnotes/footnotes' require 'rails-footnotes/backtracer' require 'rails-footnotes/view_subscriber' # Require each individual note notes_glob = File.expand_path("../rails-footnotes/notes/*.rb", __FILE__) Dir[notes_glob].each{|note| require note } # Subscribe to view events so we can use them later ActiveSupport::LogSubscriber.attach_to(:action_view, Footnotes.view_subscriber) # The footnotes are applied by default to all actions. To remove the # footnotes from an action, use skip_filter in your controller. ActionController::Base.prepend_before_filter Footnotes::BeforeFilter ActionController::Base.after_filter Footnotes::AfterFilter end end # Hook into the logger so we can collect logs initializer "rails3-footnotes.hook_logger" do if ::Rails.env.development? raise ArgumentError, "The logs footnote requires a logger" unless Rails.logger Rails.logger.extend LoggingExtensions end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails3-footnotes-4.0.0.pre.9 | lib/rails-footnotes.rb |