The first kind:?
ROR Code
Class Foocontroller < Applicationcontroller?
? ? Protect_from_forgery:except =: Index?
???
?? # can disable CSRF protection on controller-by-controller basis:?
? ? Skip_before_filter:verify_authenticity_token?
End?
Class Foocontroller < Applicationcontroller protect_from_forgery:except =: Index # You can disable CSRF protection On Controller-by-controller Basis:skip_before_filter:verify_authenticity_token End
??
??
The second kind:?
Modify configuration file config\environments\development.rb?
??
??
ROR Code
# Disable Request forgery protection in development environment?
??? config.action_controller.allow_forgery_protection = False?
??
Then restart the server?
??
??
The Third Kind:?
Join in jquery or form?
Ruby Code
<%= tag (: input,: type = "hidden",: name = =??)
request_forgery_protection_token.to_s,: Value = =??
Form_authenticity_token)%>?
??
from <http://blog.csdn.net/iam_song/article/details/7688631>
Actioncontroller::invalidauthenticitytoken Solutions (the second is particularly effective)