Answer the question
In order to leave comments, you need to log in
What is the correct way to call ajax via jQuery in a rails application?
I figured out how to work with Ajax through helpers and the remote true parameter.
But here, through jQuery, I can’t figure out how to call ajax and correctly process it on the server and return it to the client.
there is a checkbox on the form there
is javascript that monitors the checkbox switching, how can I call an ajax request to the server on the check event (I catch it without problems) and process it both on the server side and on the client side?
Interested in returning both in html and json format.
Answer the question
In order to leave comments, you need to log in
An example of such processing is shown in the video: railscasts.com/episodes/136-jquery?autoplay=true
There is a code example below on the page.
And what exactly is the problem?
api.jquery.com/jquery.ajax
api.rubyonrails.org/classes/ActionController/MimeR...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question