This project is archived and is in readonly mode.
Added disable_authenticity_token option to form helper
Reported by 2kan | December 27th, 2010 @ 04:09 PM | in 3.1
I've added disable_authenticity_token option to the form helper.
So now we can generate forms without authenticity_token tag.
It is useful when we generate forms for some external resources
like payments and billings where names of fields are often
restricted so forms with authenticity_token are not valid.
Now we can write:
form_for(@survey, :disable_authenticity_token => true)
or:
form_tag('/', :disable_authenticity_token => true)
Comments and changes to this ticket
-
Yaroslav Markin December 29th, 2010 @ 04:36 PM
- Assigned user set to José Valim
This is basically really useful when you need to send data to a 3td party service (payment gateway, in my case) without any Rails tokens.
-
Santiago Pastorino February 3rd, 2011 @ 04:52 PM
- State changed from new to open
- Milestone set to 3.1
- Assigned user changed from José Valim to Santiago Pastorino
- Importance changed from to Low
Looks good can you provide docs for that? would be nice to add API docs at least
-
Xavier Noria February 3rd, 2011 @ 10:04 PM
Would you please add some RDoc documenting this option and its rationale/real use case. Also please the guide that covers forms? All in a single (complete) patch.
-
Lachlan Sylvester February 4th, 2011 @ 10:10 PM
Similar functionality has been added in https://rails.lighthouseapp.com/projects/8994/tickets/2988-authenti.... I am not sure that this is still needed.
-
Dan Pickett February 4th, 2011 @ 10:24 PM
Agreed with Lachlan - this appears to be duplicated functionality that has already been committed in #2988. This ticket should be closed.
-
Santiago Pastorino February 5th, 2011 @ 12:22 AM
yeah true, but ... seems that this was not done for form_for.
Can you guys confirm this? if it was not done for form_for can you provide a patch for it using the same approach?.
Thanks. -
2kan February 5th, 2011 @ 03:14 AM
Santiago, since form_for works through form_tag we need just to write something like:
form_for(@something, :html => { :authenticity_token => 'some_token_of_false' }) do |f|
So right now this ticket is duplicate to functionality committed in #2988.
-
Santiago Pastorino February 5th, 2011 @ 03:49 AM
2kan right, but we don't have tests and docs for form_for though.
-
2kan February 5th, 2011 @ 03:41 PM
Added test for for_for and new authenticity_token option. Added docs. Added section about it to form helpers guide. All in one single patch.
-
Repository February 5th, 2011 @ 09:02 PM
- State changed from open to committed
(from [b9309b47cda12db34ac3427fbafff2dca0314ed7]) Added tests for form_for and an authenticity_token option. Added docs for for_for and authenticity_token option. Added section to form helpers guide about forms for external resources and new authenticity_token option for form_tag and form_for helpers.
[#6228 state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/b9309b47cda12db34ac3427fbafff... -
Dan Pickett February 6th, 2011 @ 04:27 PM
I dig the change, but I think putting the authenticity_token arg in the html option hash is unintuitive. I've attached a patch that puts the function in parity with the remote option.
-
Repository February 6th, 2011 @ 09:05 PM
- State changed from open to committed
(from [3026843dc1ff42a632ebe989e1f6dfadb0cd10a5]) put authenticity_token option in parity w/ remote
[#6228 state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/3026843dc1ff42a632ebe989e1f6d... -
2kan February 7th, 2011 @ 11:39 AM
- State changed from committed to open
[state:open]
Updated form helpers guide for new place of authenticity_token option in for_for helper.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 6228 Added disable_authenticity_token option to form helper [#6228 state:committed]
- 6228 Added disable_authenticity_token option to form helper [#6228 state:committed]