In my Rails 4 project I want to add 2 fields to all the forms for a controller on the server side.
I'd like to add this to all of my forms for a controller.
input name="authenticity_token" type="hidden" value='=form_authenticity_token'
input name="profilePage" type="hidden" value='#{params[:action]}'
Each view has one form.
You could make it a partial:
#_csrf.html.slim
input name="authenticity_token" type="hidden"value='=form_authenticity_token'
input name="profilePage" type="hidden" value='#{params[:action]}'
And then render it in each form:
= render 'csrf'