[Code] Rails + JQuery + ruby-openid = BZZZZT!

Rick Wayne fewayne at wisc.edu
Wed May 30 22:26:20 UTC 2012


Sante, thank you very very much! Further testing reveals that that was indeed the problem -- as you know (but others might not), Rails checks for an authenticity_token in POSTs if protect_from_forgery is turned on (which it is by default).

So with a very little more work I was able to figure out how to get that token included in Ajax requests, details at http://henrik.nyh.se/2008/05/rails-authenticity-token-with-jquery. Very slick solution, implemented in a few lines in only two files of the dozens that make up the typical Rails application.

rw

UW Soil Science
5-3288
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openid.net/pipermail/openid-code/attachments/20120530/2876bce2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7351 bytes
Desc: not available
URL: <http://lists.openid.net/pipermail/openid-code/attachments/20120530/2876bce2/attachment.p7s>


More information about the Code mailing list