Jquery 签出&x2B;轨道4+;移动+;获取而不是删除

Jquery 签出&x2B;轨道4+;移动+;获取而不是删除,jquery,ruby-on-rails-4,mobile,Jquery,Ruby On Rails 4,Mobile,我有一个rails 4应用程序“注销”在计算机浏览器中运行良好,但在我尝试从移动浏览器注销时出现错误 #Sign out using comp browser Started DELETE "/users/sign_out" for 127.0.0.1 at 2013-09-12 10:40:40 +0530 Processing by SessionsController#destroy as HTML Parameters: {"authenticity_token"=>"pp6ZHE

我有一个rails 4应用程序“注销”在计算机浏览器中运行良好,但在我尝试从移动浏览器注销时出现错误

#Sign out using comp browser
Started DELETE "/users/sign_out" for 127.0.0.1 at 2013-09-12 10:40:40 +0530
Processing by SessionsController#destroy as HTML
Parameters: {"authenticity_token"=>"pp6ZHEz2JQbuh3YzM87OOLpiq3Yb/PauYY7k7gwhl94="}
MOPED: 127.0.0.1:27017 QUERY        database=app_development collection=users selector={"$query"=>{"_id"=>"52314382f94adc80ab000002"}, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 batch_size=nil fields=nil (0.4578ms)
Redirected to http://localhost:3000/
Completed 302 Found in 40ms

Started GET "/" for 127.0.0.1 at 2013-09-12 10:40:40 +0530
Processing by HomeController#index as HTML
Completed 401 Unauthorized in 1ms

Started GET "/users/sign_in" for 127.0.0.1 at 2013-09-12 10:40:40 +0530
Processing by SessionsController#new as HTML
Rendered devise/shared/_links.html.haml (0.6ms)
Rendered devise/sessions/new.html.haml within layouts/login (7.3ms)
Rendered shared/_flash_notice.html.haml (0.3ms)
Rendered shared/_ie.html.haml (0.1ms)
Completed 200 OK in 38ms (Views: 36.5ms)

#Sign out using mobile browser
Started GET "/users/sign_out" for 192.168.1.153 at 2013-09-12 10:40:53 +0530
Processing by UsersController#show as HTML
Parameters: {"id"=>"sign_out"}
MOPED: 127.0.0.1:27017 QUERY        database=app_development collection=users selector={"$query"=>{"_id"=>"5231438bf94adc80ab000009"}, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 batch_size=nil fields=nil (1.3361ms)
MOPED: 127.0.0.1:27017 QUERY        database=app_development collection=users selector={"_id"=>"sign_out"} flags=[:slave_ok] limit=0 skip=0 batch_size=nil fields=nil (0.4921ms)
Completed 404 Not Found in 9ms

Mongoid::Errors::DocumentNotFound (
Problem:
Document(s) not found for class User with id(s) sign_out.
Summary:
  When calling User.find with an id or array of ids, each parameter must match a document in the database or this error will be raised. The search was for the id(s): sign_out ... (1 total) and the following ids were not found: sign_out.
Resolution:
  Search for an id that is in the database or set the Mongoid.raise_not_found_error configuration option to false, which will cause a nil to be returned instead of raising this error when searching for a single id, or only the matched documents when searching for multiples.):
  app/controllers/users_controller.rb:10:in `show'
我在应用程序控制器中有jquery和jquery_ujs

//= require jquery
//= require jquery_ujs

我认为jquery_ujs没有在移动浏览器中加载。我尝试了几个不同的单元(apple、android n windows),但得到了相同的错误。

如果您使用Desive gem进行授权,请设置config.sign_out_via=:进入您的配置/initializers/Desive.rb file.CSRF令牌身份验证将在get请求中跳过。在添加、修改数据时,不应使用GET。在这种情况下,应该使用POST或DELETE。