Module: Ajax::Routes

Defined in:
lib/ajax/routes.rb

Class Method Summary collapse

Class Method Details

.draw(map) ⇒ Object

In your config/routes.rb file call:

Ajax::Routes.draw(map)

Passing in the routing map object.

Adds an ajax_framework_path pointing to Ajax.framework_path which is /ajax/framework by default.

Only applies when installed as a gem in Rails 2 or less.



11
12
13
14
15
16
17
# File 'lib/ajax/routes.rb', line 11

def self.draw(map)
  if Ajax.app.rails?(3) && map.respond_to?(:match)
    map.match Ajax.framework_path, :to => 'ajax#framework', :as => 'ajax_framework'
  else
    map.ajax_framework Ajax.framework_path, :controller => 'ajax', :action => 'framework'
  end
end