Commit 388d3d82 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Add authenticity_token: true to multipart forms



Rails 4 does not generate token by default
It fixes bug when you get to sign-in page after trying to upload image
with comment
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 2bd6610ef0af
......@@ -8,7 +8,7 @@
= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit_user form-horizontal" } do |f|
= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit_user form-horizontal" }, authenticity_token: true do |f|
-if @user.errors.any?
%div.alert.alert-error
%ul
......
= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form common-note-form" } do |f|
= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form common-note-form" }, authenticity_token: true do |f|
= note_target_fields
= f.hidden_field :commit_id
......
......@@ -3,7 +3,7 @@
- if can? current_user, :write_note, @project
.note-form-holder
= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note wall-note-form" } do |f|
= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note wall-note-form" }, authenticity_token: true do |f|
= note_target_fields
.note_text_and_preview
= f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment