rlivsey / js_routes

Make your Rails routes available to Javascript

This URL has Read+Write access

rlivsey (author)
Thu Jan 22 03:35:31 -0800 2009
commit  d5c44f80a3d788980d36c586abb2857b5195d265
tree    a7c98c2f73885c6f6af448d6ba04d3ad04b4ecee
parent  9543008bc3e482f6ba782d42fdd3f70907930d4c
js_routes / init.rb
100644 7 lines (6 sloc) 0.24 kb
1
2
3
4
5
6
7
# Include hook code here
require 'dispatcher'
require 'js_routes'
 
Dispatcher.to_prepare :js_routes_route do
  ActionController::Routing::Routes.add_route '/javascripts/js_routes.js', :controller => 'js_routes', :action => 'index'
end