How to use Ajax with rails ?

Hi all,

Can any one tell me how to use Ajax with Rails.

Send me quick start up link and videos.

Thanks

Regards

Fahim Babar PAtel

Try Google. :slight_smile:

https://www.google.com/search?q=ajax+with+rails&oq=ajax+with+rails&sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8

Include jquery-rails and do it like you normally would.

Ajax is the default functionality from rail no need of extra packages, ensure following things you have included
1)ensure rails.js in public/javascripts files if, you are using < 3.0. if, you are using >3.0 then auto metically it will includes in application.js(manifest file)
2) use :remote=> true in the link_for or form tags
ex:- <%=link_to 'Remote Link', home_path,:remote=>true%>

it’s still in edgeguides but it’s a nice intro written by @steveklabnik (if i’m not mistaken) http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html

cheers

I have just been reading this and finding it helpful background with
some nice examples:

http://madebydna.com/all/code/2011/12/05/ajax-in-rails-3.html

http://railscasts.com/episodes?utf8=%E2%9C%93&search=ajax