rails3和jquery

话说rails3.1中默认的js库已经是jquery了,这让我显得很高兴,因为我对jquery是比较熟悉的。原来看了一段时间prototype,发现这个库太大了,可能prototype比较稳定吧,不知道,反正个人感觉挺好的。

首先建立一个新项目,实际上有没有-J都无所谓

rails new helloworld -J

然后,在项目的Gemfile中添加,

gem 'jquery-rails'

运行

bundle install

再运行

rails generate jquery:install

当然如果你想用jquery-ui的话,你可以。

rails generate jquery:install --ui

2 thoughts on “rails3和jquery

  1. Pingback: rails3和jquery « 太阳照常升起

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">