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?
- Remove the jquery gem from Gemfile
- 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
精彩评论