I didn’t skip prototype when I began my new project and I want to move to JQuery. What is the best way to switch libraries?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can delete the prototype/scriptaculous and rails.js libraries. Then copy jquery and the ujs adapter for jquery to you javascripts directory and include them in your layout.
I recommend checking out the rails3-generators plugin. It provides generators for common tasks like this. In the jquery case you would just run the
rails g jquery:installgenerator and the files would be copied for you and the JAVASCRIPT_DEFAULT_SOURCES set in an initializer so thatjavascript_include_tag :defaultsstill works.