June 2008
4 posts
Rails Form Authenticity Token with Ajax (Defensive...
When sending POST through ajax with form security turned on with Rails can sometimes be a pain in the butt. However if you plan for your users to be able to do the same task without javascript, adding the Ajax goodness unobtrusively is a cinch and we still get the benefits of the authenticity token.
The example below is a simple form for a post. But Rails will automatically set the security...