Sha256: 931fc19fb3d5436ba43717e30847836aacfadd7fbac271f85a006568590768eb

Contents?: true

Size: 942 Bytes

Versions: 3

Compression:

Stored size: 942 Bytes

Contents

module DT
  module ActionControllerExtensions   #:nodoc:
    def self.included(owner)    #:nodoc:
      owner.extend MetaClassMethods
    end

    module MetaClassMethods
      # Enable DT in the controller.
      #
      #   class ApplicationController < ActionController::Base
      #     handles_dt
      #   end
      def handles_dt
        # NOTE: after_filter() is nicer and lets debug more, but... It's not getting control when there's a rendering exception, such as 404.
        #       Use log and console to debug complex stuff like prefilters.
        before_filter {DT.clear_web_messages}
      end
    end # MetaClassMethods
  end # ActionControllerExtensions
end # DT

# NOTE: This MUST be outside DT module, otherwise rdoc will produce ugly doc for DT module.
if defined? ::ActionController::Base
  module ::ActionController    #:nodoc:
    class Base    #:nodoc:
      include DT::ActionControllerExtensions
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_dt-0.1.4 lib/dt/action_controller_extensions.rb
rails_dt-0.1.3 lib/dt/action_controller_extensions.rb
rails_dt-0.1.2 lib/dt/action_controller_extensions.rb