Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 我用过before\u过滤器:authenticate\u user!在我的控制器中,如何获取json格式的数据_Ruby On Rails_Ruby On Rails 3_Devise - Fatal编程技术网

Ruby on rails 我用过before\u过滤器:authenticate\u user!在我的控制器中,如何获取json格式的数据

Ruby on rails 我用过before\u过滤器:authenticate\u user!在我的控制器中,如何获取json格式的数据,ruby-on-rails,ruby-on-rails-3,devise,Ruby On Rails,Ruby On Rails 3,Devise,我用过before\u过滤器:authenticate\u user!在我的控制器中,如果我移除它并 curl-H'Content-Type:application/json'-H'Accept:application/json'-X GEThttp://localhost:3000/posts 然后我看到json数据。那么如何使用before\u过滤器:authenticate\u user!以确保安全。您可以用于JSON请求,因此可以在http头中包含身份验证信息。并不真正理解您的问题。你想

我用过before\u过滤器:authenticate\u user!在我的控制器中,如果我移除它并

curl-H'Content-Type:application/json'-H'Accept:application/json'-X GEThttp://localhost:3000/posts


然后我看到json数据。那么如何使用before\u过滤器:authenticate\u user!以确保安全。

您可以用于JSON请求,因此可以在http头中包含身份验证信息。

并不真正理解您的问题。你想做什么?我想要iphone应用程序的json,我使用Desive作为身份验证,登录后我想要posts控制器的json。我该怎么做