Ruby on rails 在移动应用程序中使用Desive gem身份验证的问题(钛)

Ruby on rails 在移动应用程序中使用Desive gem身份验证的问题(钛),ruby-on-rails,titanium-mobile,Ruby On Rails,Titanium Mobile,我正在Rails应用程序中使用Desive gem进行身份验证。我可以通过以Json请求格式传递数据来创建用户,从而从Tianium移动应用程序设计rails应用程序。 但当我尝试在移动应用程序中设置登录以使用Desive时,它显示了一个错误,如下所示 {"error":"You need to sign in or sign up before continuing."} var regDetails = '{"email": "'+userNmTxt.value+'", "password

我正在Rails应用程序中使用Desive gem进行身份验证。我可以通过以Json请求格式传递数据来创建用户,从而从Tianium移动应用程序设计rails应用程序。 但当我尝试在移动应用程序中设置登录以使用Desive时,它显示了一个错误,如下所示

{"error":"You need to sign in or sign up before continuing."}
var regDetails = '{"email": "'+userNmTxt.value+'", "password": "'+passwordTxt.value+'"}';
       var client = Titanium.Network.createHTTPClient({timeout: 5000});
       client.open("POST", "http://10.100.85.43:3000/session/create");
       client.setRequestHeader("Content-Type", "application/json");
       client.send(regDetails);        
       client.onload = function(e)
       {
               alert('Logged in successfully' + this.responseText);
       }
       client.onerror = function(e)
       {
               alert('On error' + this.responseText);
       }
我的代码如下所示

{"error":"You need to sign in or sign up before continuing."}
var regDetails = '{"email": "'+userNmTxt.value+'", "password": "'+passwordTxt.value+'"}';
       var client = Titanium.Network.createHTTPClient({timeout: 5000});
       client.open("POST", "http://10.100.85.43:3000/session/create");
       client.setRequestHeader("Content-Type", "application/json");
       client.send(regDetails);        
       client.onload = function(e)
       {
               alert('Logged in successfully' + this.responseText);
       }
       client.onerror = function(e)
       {
               alert('On error' + this.responseText);
       }

我做错了什么?

我找到了解决方案,我在
routes.rb
文件中丢失了一些路由信息

devise_scope :user do
   match "/session/create" => "session#create" #, :via => [:get, :post]
   match "/session/destroy" => "session#destroy" #, :via => [:get, :post] 
   match "/registration/create" => "registration#create" #, :via => [:get, :post]
end
希望这对某人有所帮助:)