I am having page.replace_html with a partial in the controller. What is the correnponding .js file that i had to include to support this .
Thanks,
Ramya.
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.
Assuming you are using Rails 2.3.x Prototype and its dependencies are already present in the framework. In you application you can include prototype.js specifically or use
<%= javascript_include_tag :defaults %>which includes all the js files Rails provides, if application.js is there then that is included as well. PrototypeHelper in rails gives you the methodsreplace_htmletc. If you use jquery instead of prototype then you would have to use jrails plugin.In Rails 3 jQuery is present by default and jrails is not going to work. Rails 3 removed the the link between its Javascript helpers and Prototype, as unobtrusive way is recommended to do those things. However, you could user the Prototype Legacy Helper provided by Rails to get those methods.