Difference between simple ajax and :remote => true In Ruby on Rails

Actually I have two, three questions but the heart of three question is same as written in Title . But I make my all points clear here in description

Following will be the specification of my question

Javascript file path => assets/javascript/
js.erb file path     => views/customers/index.js.erb
view file name       => views/customerS/html.erb
controller name      => customers
action name          => index

point # 1

If I make ajax call to my customers/index through my javascript file (with the mentioned path) then will it hit the index.js.erb file ?

point # 2

can we use js and js.erb file for the same action . what i mean is ‘is it possible to send ajax from js file in assets folder and after controller action say index method handle the response in index.js.erb file in view folder ?’

point # 3

Say we can handle the response in index.js.erb file then how can / or if we can stop sending back the response / data in js file

if I have missed some more related points then kindly edit the question and place those , so that maximum people can enjoy the knowledge

Also have a look at This question and answer if you can


Source: jquery

Leave a Reply