简体   繁体   English

如何在Ruby on Rails中安装jquery?

[英]how do you install jquery in Ruby on Rails?

只是将javascript文件夹中的jquery.jq文件安装并链接到此即可吗?

What version of Rails are you running? 您正在运行哪个版本的Rails?

For Rails 2.x, you will probably also want to install the jrails plugin to provide jquery versions of all the javascript helpers like link_to_remote and periodically_call_remote . 对于Rails 2.x,您可能还需要安装jrails插件以提供所有javascript帮助器的jquery版本,例如link_to_remoteperiodically_call_remote

For Rails 3.0, you should download the jquery-ujs version of rails.js from github to achieve the same functionality. 对于Rails 3.0,您应该从github下载rails.jsjquery-ujs版本以实现相同的功能。

Otherwise, you'll have to write all your AJAX manually if you just remove prototype and scriptaculous and drop in jquery.js . 否则,如果您仅删除prototypescriptaculous并放入jquery.js则必须手动编写所有AJAX。

是的,删除默认的js文件并放置您自己的文件,然后将其包含在布局中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM