简体   繁体   中英

How to enable ajax request in Rails application

Someone please explain me how do I send ajax request to enable ajax in my application. In my controller I have this code in the respond_to block

 format.html {  }
 format.xml  {  }
 format.js {}

Normally .html response is always sent back to the user. But I want to know how can I enable .xml or .js and how this works.

Check out the Rails Guides on Working with Javascript in Rails . The linked to section should be particularly helpful in understanding this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM