module UJS module Routing # TODO add an implied route so that '/behaviors/*path.js' hits 'ujs/behavior_controller' # action behavior module MapperExtensions def behaviors(options={}) options = options.merge( :controller => "ujs/behavior_controller", :action => "behavior", :requirements => { :path => /.+\.js/ }, :conditions => { :method => :get } ) @set.add_route('/behaviors/*path', options) end end end end