Why do we use request.xhr? in rails

Answers were Sorted based on User's Feedback



Why do we use request.xhr? in rails..

Answer / surekha matte

request.xhr? indicates the controller has
received an ajax request. It returns true or false

Is This Answer Correct ?    71 Yes 8 No

Why do we use request.xhr? in rails..

Answer / moin haidar

Conventional web application transmit information to and
from the sever using synchronous requests. This means you
fill out a form, hit submit, and get directed to a new page
with new information from the server.
When you interact with an Ajax-powered web page, it loads an
Ajax engine in the background. In response to an event web
application passes asynchronous request (XMLHttpRequest or
xhr). In fact it is javaScript object/method that performs
asynchronous interaction with the server, JavaScript object
that performs asynchronous interaction with the server and
behind the scene fetches data. and behind the scene fetches
data.
We do request.xhr? only to check the request type, either
its AJAX request or others(post, get).

Is This Answer Correct ?    43 Yes 11 No

Post New Answer

More Ruby on Rails Interview Questions

Explain me what is the naming convention in rails?

0 Answers  


What is bundler?

0 Answers  


Where does the start_tabnav gets informations for tabs rendering in ruby rail?

0 Answers  


what are the positive aspects of Rails?

0 Answers  


What is the main function of helpers used in ruby on rails?

0 Answers  






Explain testing in rails.

0 Answers  


What is the difference between render and redirect?

0 Answers  


what is the difference between destroy and delete?

0 Answers  


What are filters? and how many types of filters are there in ruby

2 Answers   Baidu, TCS,


What does session and cookies represent in ruby on rails?

0 Answers  


Is it possible to build a 50% bespoke e-commerce platform hence having the ability to customize everything down the line? For example would it make sense to start coding an application on the Ruby on Rails framework but where the most complex/time consuming code pieces (e.g. shopping cart, etc) can be initially bolted on (hence diminishing development time and cost) having the ability to change them completely further down the line?

1 Answers  


What can Rails Migration do?

0 Answers  


Categories