I'm new in Rails 4. I want to delay HTTP response.
I thought the 'respond_to' method is enable to respond to HTTP request.
However, When I removed the 'respond_to' method, The rails controller automatically responded to request.
Below is my step for this.
Send HTTP Request in view
[index.html.erb] <script> var ready = function() { alert('this is function'); } var aquery = function() { $.ajax({ type : "POST", url : "app/subaction", }); } $(document).on('ready page:load', aquery); </script>
Receive HTTP Request in Controller
class AppController < ApplicationController def subaction (Nothing here...) end end
subaction.js.erb
$('#div_id').empty().append("Complete response ...");
In this step, response was executed automatically although there is not "respond_to" method.
Can I delay the response ??? Can you explain request-response operation in rails ?
Thank you...