Searched around for a while, the common solution to it is to insert <%= csrf_meta_tags %> to layout header. However, it makes no difference. Installing jquery-rails doesn't help either
Rails 3.1.0 Ruby 1.9.2 Mongoid 2.2.0
Another weird thing after coming to 3.1 is that when I check routes by rake routes, there are some urls not specified by url helpers, like GET, PUT and DELETE have the same url but only the first one cat be reached by helper defined url.
edit_message GET /:permalink/messages/:id/edit(.:format){:action=>"edit", :controller=>"messages"}
message GET /:permalink/messages/:id(.:format){:action=>"show", :controller=>"messages"}
PUT /:permalink/messages/:id(.:format) {:action=>"update", :controller=>"messages"}
DELETE /:permalink/messages/:id(.:format) {:action=>"destroy", :controller=>"messages"}