def init
      return unless rails?
      if rails?(:>=, 3)
        require 'ajax/railtie'
      else
        require 'ajax/action_controller'
        require 'ajax/action_view'

        Ajax.logger = ::Rails.logger

        # Customize rendering.  Include custom headers and don't render the layout for AJAX.
        ::ActionController::Base.send(:include, Ajax::ActionController)

        # Insert the Rack::Ajax middleware to rewrite and handle requests
        ::ActionController::Dispatcher.middleware.insert_before(Rack::Head, Rack::Ajax)

        # Add custom attributes to outgoing links
        ::ActionView::Base.send(:include, Ajax::ActionView)
      end
    end
def init
      return unless rails?
      if rails?(:>=, 3)
        require 'ajax/railtie'
      else
        require 'ajax/action_controller'
        require 'ajax/action_view'

        Ajax.logger = ::Rails.logger

        # Customize rendering.  Include custom headers and don't render the layout for AJAX.
        ::ActionController::Base.send(:include, Ajax::ActionController)

        # Insert the Rack::Ajax middleware to rewrite and handle requests
        ::ActionController::Dispatcher.middleware.insert_before(Rack::Head, Rack::Ajax)

        # Add custom attributes to outgoing links
        ::ActionView::Base.send(:include, Ajax::ActionView)
      end
    end
Include framework hooks for Rails

 This method is called by <tt>init.rb</tt>, which is run by Rails on startup.

 Customize rendering.  Include custom headers and don't render the layout for AJAX.
 Insert the Rack::Ajax middleware to rewrite and handle requests.
 Add custom attributes to outgoing links.

 Hooks for Rails 3 are installed using Railties.