Rails 2.0 以降から導入されたCSRF対策のAuthenticityTokenですが、 JavaScriptからこれを取得する方法のメモ。

   1  $$('input[name="authenticity_token"]')[0].value

Ajax.Request等で呼び出す場合のお供に。

posted by Png genki on Sat 19 Apr 2008 at 09:46

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry532
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ