what is InvalidAuthenticityToken?

16 views
Skip to first unread message

Zhenning Guan

unread,
Mar 2, 2010, 9:21:29 AM3/2/10
to rubyonra...@googlegroups.com
I create a ruby script to submit a post to my local rails application,
but doesn't return a data. so I open a log file, saw this.
---
ActionController::InvalidAuthenticityToken
(ActionController::InvalidAuthenticityToken):
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
--

I want to submit a post, How can I ?
--
Posted via http://www.ruby-forum.com/.

Andy Jeffries

unread,
Mar 2, 2010, 11:34:51 AM3/2/10
to rubyonra...@googlegroups.com
http://guides.rubyonrails.org/security.html#cross-site-request-forgery-csrf

You can use:


To get the value (or use form_for, which automatically handles it).

Cheers,


Andy

--
Andy Jeffries
http://andyjeffries.co.uk/      #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply all
Reply to author
Forward
0 new messages