Use form_tag instead of building forms by hand
In order for CSRF protection to work we need to use form_for or form_tag to build all forms so that the authenticity token is added.
This commit is contained in:
parent
09e5528ecd
commit
2bc44dfddc
2 changed files with 4 additions and 4 deletions
|
@ -6,11 +6,11 @@ $("content").style.display = "none";
|
|||
|
||||
<p><%= t 'user.confirm.press confirm button' %></p>
|
||||
|
||||
<form id="confirm" method="post">
|
||||
<%= form_tag({}, { :id => "confirm" }) do %>
|
||||
<input type="display_name" name="confirm_string" value="<%= params[:display_name] %>">
|
||||
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
|
||||
<input type="submit" name="confirm_action" value="<%= t 'user.confirm.button' %>">
|
||||
</form>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$("confirm").submit();
|
||||
|
|
|
@ -6,10 +6,10 @@ $("content").style.display = "none";
|
|||
|
||||
<p><%= t 'user.confirm_email.press confirm button' %></p>
|
||||
|
||||
<form id="confirm" method="post">
|
||||
<%= form_tag({}, { :id => "confirm" }) do %>
|
||||
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
|
||||
<input type="submit" name="confirm_action" value="<%= t 'user.confirm_email.button' %>">
|
||||
</form>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$("confirm").submit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue