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

rails new helloworld -J

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

 

gem 'jquery-rails'

运行

 

 

bundle install

再运行

rails generate jquery:install
这时Prototype和相应JS就会被删除,而替换成JQuery的JS。

如果你要使用JQuery UI的话在上面命令后面加个 --ui就可以了。

这样你项目中的Prototype就被替换成JQuery了。

 

 

 

 

 

 

相关文章:

  • 2021-05-31
  • 2022-12-23
  • 2022-02-08
  • 2021-06-12
  • 2022-01-14
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2022-01-24
  • 2021-04-17
  • 2022-03-01
  • 2021-09-03
  • 2022-12-23
  • 2021-09-11
相关资源
相似解决方案