ruby on rails - File upload field causing ActionController::InvalidAuthenticityToken exception -
using rails 4, , trying add file field existing form, using simple_form , paperclip.
here's critical part of form:
<%= simple_form_for(@employee, html: { class: 'form-horizontal requires', multipart: true}, remote: true) |f| %> <%= f.input :avatar %> <% end %>
everything works ok, unless submit form uploaded file. then, this:
actioncontroller::invalidauthenticitytoken in employeescontroller#update
what doing wrong here?
the simplest solution add authenticity_token: true
form. this:
<%= form_for @employee, html: { class: 'form-horizontal requires'}, multipart: true, remote: true, authenticity_token: true |f| %> <%= f.input :avatar %> <% end %>
Comments
Post a Comment