From cb537324a38f6680741f2da8c074ff7220e75a4f Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 6 Jan 2017 10:33:06 +0000 Subject: Fixed edit form authenticity_token call failing the tests --- app/assets/javascripts/notes.js | 4 +++- app/views/projects/notes/_edit_form.html.haml | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 8de5a6191b6..603db88567d 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -895,7 +895,9 @@ new GLForm($editForm.find('form')); - $editForm.find('form').attr('action', postUrl); + $editForm.find('form') + .attr('action', postUrl) + .attr('data-remote', 'true'); $editForm.find('.js-form-target-id').val(targetId); $editForm.find('.js-form-target-type').val(targetType); $editForm.find('.js-note-text').focus().val(originalContent); diff --git a/app/views/projects/notes/_edit_form.html.haml b/app/views/projects/notes/_edit_form.html.haml index d36b4e6c8ab..e8e450742b5 100644 --- a/app/views/projects/notes/_edit_form.html.haml +++ b/app/views/projects/notes/_edit_form.html.haml @@ -1,6 +1,5 @@ .note-edit-form - = form_tag '#', method: :put, remote: true, class: 'edit-note common-note-form js-quick-submit' do - = hidden_field_tag :authenticity_token, form_authenticity_token + = form_tag '#', method: :put, class: 'edit-note common-note-form js-quick-submit' do = hidden_field_tag :target_id, '', class: 'js-form-target-id' = hidden_field_tag :target_type, '', class: 'js-form-target-type' = render layout: 'projects/md_preview', locals: { preview_class: 'md-preview', referenced_users: true } do -- cgit v1.2.1