レール経由でフォームを送信していますが、応答が 200 OK ヘッダーで返ってきます。完全なイベントが発生しますが、成功も失敗も発生しません。何か案は?
JS:
$('form#booking-email').bind('ajax:complete',function(){
alert('complete');
});
$('form#booking-email').bind('ajax:success',function(){
alert('success');
});
$('form#booking-email').bind('ajax:failure',function(){
alert('failure');
});
私のコントローラー
respond_to do |format|
format.json { head :ok }
end
応答:
Status: 200 OK
Cache-Control: max-age=0, private, must-revalidate
Connection: Keep-Alive
Content-Length: 1
Content-Type: application/json; charset=utf-8
Date: Sat, 03 Nov 2012 01:00:11 GMT
Etag: "7215ee9c7d9dc229d2921a40e899ec5f"
Server: WEBrick/1.3.1 (Ruby/1.9.2/2012-02-14)
Set-Cookie: _myeasybnb_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJWQ3NTE2ODMzZjMyY2RhZTU1NjAwMzk3MWIyYjdhZDMzBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMTFNN1hvWGhUdytSSjVRcCtrdWFLVTk5NnBEQWF5QXVxRlR2L1pwV1JjUmM9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBmkGSSIiJDJhJDEwJEJ3Uy5lTzI3Ly4xY05xWlhGZzJ3cy4GOwBU--bd4de54c468e9cedc322949bba91adb5a60bb92f; path=/; HttpOnly
X-Request-Id: 0bb75d4727fbe149b868214f39763030
X-Runtime: 2.183082
X-UA-Compatible: IE=Edge