Why do we use request.xhr? in rails
Answers were Sorted based on User's Feedback
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 |
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 |
What are the various changes between the rails version 2 and 3?
How do I find only duplicate entries in a database table?
what is Ruby on Rails?
how you can run Rails application without creating databases?
How many filters are there in rails.
Tell me what is coc in rails?
What is ORM in Rails?
What is Rails?
let me know what is ruby software and where and when it is usefull. Is it usefull to data base developer, if yes...where? thank you
What is rake?
how you define Instance Variable, Global Variable and Class Variable in Ruby?
What is bundler?