Equivalent to remote_function using jquery and jquery-rails

I am building an application in Rails 3.0.3 and Ruby 1.9.2. I installed jquery-rails gem and instead of jQuery instead of prototype. I have .js.erb will update the contents of the div tag, but I need to call the function in the controller to get the updated information for the div tag. Can someone give an example or point me to it? I tried railscasts an unobtrusive javascript tutorial, but I can't get it to work for my situation.

+3
source share
2 answers

See How to make Ajax calls with Rails 3 using remote_function? and my comment is there. Ibz’s answer, adding: deleted, makes sense only for form elements and even then is only part of the story.

0
source

In Rails 3, all helpers remote_methodshave been removed. To make them work with AJAX, just pass the parameter :remote => trueto the original non-remote method.

Link: Unobtrusive JavaScript in Rails 3

0
source

Source: https://habr.com/ru/post/1788733/


All Articles