Everything about AJAX in Rails

In-Depth lookout over AJAX operation in Rails application

Tushar Adhao
1 min readMar 29, 2020

AJAX which is an abbreviation for Asynchronous JavaScript And XML through which web application can send or retrieve data asynchronously (in the background) in the client/frontend side without interfering with the display and behavior of the loaded web-page. Rather doing more chit-chat lets see the ways through which we can use AJAX to enhance the UX for any web application specially built using Ruby on Rails.

So, broadly the AJAX operation in Rails application can be classified in few ways as follows,

  1. Rails way of AJAX with remote: true
  2. Tradition way of AJAX (only with Javascript/Jquery)

Then there comes the use cases for these AJAX operations which of course depends on the scenario while writing the code but broadly they can be classified as below,

  1. Different (use-cases) ways of dealing with AJAX operation
  • AJAX request handling using partials
  • Dedicated response handling page (js.erb) for handling response for AJAX in Rails
  • Shorthand for using AJAX requests

Let’s go through all of the ways of using the AJAX for Rails application in their separate sections.

--

--

Tushar Adhao
Tushar Adhao

Written by Tushar Adhao

Software artist spreading nuggets of coding gold and sometimes philosophy too.

No responses yet