jquery - 在 Rails 中使用 jquery

标签 jquery ruby-on-rails

我计划在 Rails 中使用 jquery 而不是原型(prototype)。

我不确定使用 jRails 或使用普通 jquery 并远离 RJS。

你对此有何看法?

编辑:两周后我发现了这个http://www.loudthinking.com/posts/32-myth-3-rails-forces-you-to-use-prototype

编辑:This截屏视频也很有趣。

最佳答案

如果你问我,远离 RJS 是个好主意。 RJS 是一种非常酷的 hack,但对于生产代码来说,测试和调试却很痛苦。我建议坚持使用 UJS(Unobtrusive JavaScript),而 jQuery 是实现 UJS 的好方法。

关于jquery - 在 Rails 中使用 jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/245733/

相关文章:

jquery 逗号 css 更改

ruby-on-rails - cucumber 找不到步骤定义

ruby-on-rails - rails : complicated design choice: polymorphism? STI?

javascript - jQuery 在淡入之前淡出

javascript - 如何在 jquery 中更改 bootstrap glyphicon 颜色

ruby-on-rails - 使用 Rails 构建 PostGIS 查询

ruby-on-rails - 通过关联显示 has_many 作为 Active Admin 索引中的列

ruby-on-rails - 创建新用户时 ActiveModel::ForbiddenAttributesError

jquery - 垂直居中文本 (jQuery)

jquery - 伪装成不需要的亲戚的超链接