Module: EffectiveLogging::LogPageViews::ActionController

Defined in:
lib/effective_logging/log_page_views.rb

Instance Method Summary collapse

Instance Method Details

#log_page_views(options = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/effective_logging/log_page_views.rb', line 5

def log_page_views(options = nil)
  @log_page_view_options = options || {}

  include EffectiveLogging::LogPageViews::InstanceMethods
  extend EffectiveLogging::LogPageViews::ClassMethods

  # Break up the options
  logging_options = {} ; filter_options = {}
  (@log_page_view_options || {}).each do |k, v|
    [:details, :skip_namespace].include?(k) ? (logging_options[k] = v) : (filter_options[k] = v)
  end

  cattr_accessor :log_page_views_opts
  self.log_page_views_opts = logging_options

  # Set up the after_filter to do page logging
  after_action :effective_logging_log_page_view, filter_options
end

#skip_log_page_views(options = {}) ⇒ Object



24
25
26
# File 'lib/effective_logging/log_page_views.rb', line 24

def skip_log_page_views(options = {})
  # Nothing
end