rails :: how js responses are evaluated

117 views Asked by At

We know if you use form with remote true and render js as response it works. But I would like to know where those responses are evaluated. I guess I didnt find anything in jquery_ujs.js.

1

There are 1 answers

1
AytanLeibowitz On

If your controller has a js response for the create action:

def create
  respond_to do |format|
    format.js
  end
end

Then, once you submit your form (using the remote: true option), then whatever you put in the create.js.erb file is essentially your ajax:success response.