github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

rlivsey / js_routes

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 5
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Make your Rails routes available to Javascript — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

fix layout of readme 
Richard Livsey (author)
Thu Jan 22 03:35:31 -0800 2009
commit  d5c44f80a3d788980d36c586abb2857b5195d265
tree    a7c98c2f73885c6f6af448d6ba04d3ad04b4ecee
parent  9543008bc3e482f6ba782d42fdd3f70907930d4c
js_routes /
name age
history
message
file .DS_Store Loading commit data...
file README.markdown
file Rakefile
file init.rb
file install.rb
directory lib/
directory tasks/
directory test/
file uninstall.rb
directory views/
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
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server