开发者

How to swap jquery for prototype in Rails 3.1

I have a rails 3.1 project that was created with the default jQuery. What is the b开发者_开发技巧est way to convert the project to use prototype instead?


  1. Remove the jquery gem from Gemfile
  2. add prototype-rails to it

From https://github.com/rails/prototype-rails:

You may want to add them to your app/assets/javascripts/application.js:

//= require prototype
//= require prototype_ujs
//= require effects
//= require dragdrop
//= require controls

New applications using this may also want to add

config.action_view.debug_rjs = true

to their config/environments/development.rb.


diodeus is right, i'd rewrite it, and take it as a great opportunity to improve the code ;) nevertheless i'm curious, why would you wanna switch TO prototype

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜