在JavaScript中访问Rails路线 [英] Accessing rails routes in javascript
本文介绍了在JavaScript中访问Rails路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以解释我如何使用javascript访问Rails路线/名称路线吗?
Can anyone explain how i can access the rails routes/names routes in javascript ?
以下是我尝试过的一些事情
http://github.com/jsierles/js_named_routes 。
The following are some of the things i tried http://github.com/jsierles/js_named_routes.
但是没有运气。
推荐答案
我花了一段时间研究这个问题,但没有发现任何与Rails 3兼容的实现。
I was researching this question for a while and didn't found any implementation compatible with Rails 3.
所以决定写自己的东西:
So decided to write my own:
https://github.com/railsware/js-routes
这篇关于在JavaScript中访问Rails路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文