Skip to content

Commit

Permalink
add authenticity token into ajax requests. closes NUBIC#120
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Yoon committed Mar 18, 2011
1 parent eb09693 commit 353b587
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -12,7 +12,7 @@ jQuery(document).ready(function(){
// }else{
// // Other browsers just use the change event on the form
jQuery("form#survey_form input, form#survey_form select, form#survey_form textarea").change(function(){
question_data = $(this).parents('fieldset[id^="q_"]').find("input, select, textarea").serialize();
question_data = $(this).parents('fieldset[id^="q_"]').find("input, select, textarea").add($("form#survey_form input[name='authenticity_token']")).serialize();
// console.log(unescape(question_data));
$.ajax({ type: "PUT", url: $(this).parents('form#survey_form').attr("action"), data: question_data, dataType: 'json', success: successfulSave })
});
Expand Down

0 comments on commit 353b587

Please sign in to comment.