rlivsey / js_routes
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
d5c44f8
commit d5c44f80a3d788980d36c586abb2857b5195d265
tree a7c98c2f73885c6f6af448d6ba04d3ad04b4ecee
parent 9543008bc3e482f6ba782d42fdd3f70907930d4c
tree a7c98c2f73885c6f6af448d6ba04d3ad04b4ecee
parent 9543008bc3e482f6ba782d42fdd3f70907930d4c
js_routes / README.markdown
JsRoutes
Note this is a fairly old plugin, js_named_routes is a more up to date and fully featured take on the same problem.
Include '/javascripts/js_routes.js' in your HTML and it makes your routes available in javascript.
<%= javascript_include_tag :js_routes %>
In rails:
message_url(@message, :format => 'js')
Javascript:
var message_id = 1;
message_url(message_id, {format: 'js'})
These are built on the fly, to cache them for production run the task:
$rake js_routes:cache
