[英]Restful API in rails 3
How should I go about creating a restful API in rails 3 app? 我应该如何在rails 3 app中创建一个安静的API? Also I would like to know if there is a good way to implement restful authentication 另外我想知道是否有一种很好的方法来实现restful身份验证
如果您正在寻找一种方法来验证使用您的API的应用程序,请查看restful_api_authentication gem - https://rubygems.org/gems/restful_api_authentication
The easiest way to create RESTful authentication in Rails is the combination of a User Model and a Session controller. 在Rails中创建RESTful身份验证的最简单方法是组合用户模型和会话控制器。 So you will have new(login), create(authenticate), destroy(logout) actions in the Session controller. 因此,您将在会话控制器中进行新的(登录),创建(身份验证),销毁(注销)操作。 Depending on the app its fairly easy to write your own authentication. 根据应用程序,它很容易编写自己的身份验证。 This screencast shows how easy it is. 这个截屏视频显示它是多么容易。 Authentication in Rails 3.1 Rails 3.1中的身份验证
你可以使用插件葡萄
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.