Skip to content

Commit

Permalink
Updated form rails guide for new place of authenticity_token option
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information
tukan authored and spastorino committed Feb 7, 2011
1 parent 65e08cf commit 7a77425
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions railties/guides/source/form_helpers.textile
Expand Up @@ -782,18 +782,18 @@ Sometimes when you submit data to an external resource, like payment gateway, fi
<% end %>
</erb>

The same technique is available for the +form_for+ too. You need just to set an +authenticity_token+ through +html+ options:
The same technique is available for the +form_for+ too:

<erb>
<%= form_for @invoice, :url => external_url, :html => { :authenticity_token => 'external_token' } do |f|
<%= form_for @invoice, :url => external_url, :authenticity_token => 'external_token' do |f|
Form contents
<% end %>
</erb>

Or if you don't want to render an +authenticity_token+ field:

<erb>
<%= form_for @invoice, :url => external_url, :html => { :authenticity_token => false } do |f|
<%= form_for @invoice, :url => external_url, :authenticity_token => false do |f|
Form contents
<% end %>
</erb>
Expand Down

0 comments on commit 7a77425

Please sign in to comment.