jquery - How to return HTML from a AJAX call in Rails and fire the ajax:success event? -
i have form remote: true
set.
here's relevant coffeescript:
document.addeventlistener 'turbolinks:load', -> $(document).on 'ajax:success', "form.new_carrier.specific", (event, data) -> console.log data console.log data.responsetext
i have following in create method of controller:
respond_to |format| format.html { redirect_to_user } format.js render partial: 'carriers/for_order', layout: false end end
i want return html partial, correctly doing. jquery expecting json response, not html, ajax:success
event never gets called (though can use ajax:complete
). how can make above return response ajax:success
event called?
Comments
Post a Comment