【问题标题】:In Rails, what is the "API" of Restful Authentication?在 Rails 中,Restful 身份验证的“API”是什么?
【发布时间】:2011-07-02 22:39:43
【问题描述】:

使用 Restful 身份验证 (https://github.com/technoweenie/restful-authentication),是否有适用于它添加到 Rails 项目的所有方法的 API?

到目前为止,我找到了

current_user  # returns a User object of current logged in user, nil if none
logged_in?    # returns true/false whether there is a logged in user
before_filter :login_required   # if no logged in user, redirects to the login page

是否有完整的可用方法/API 列表?在过去,我们总是有一个完整的可以调用的方法/函数列表,但有时在 Rails 中,我发现信息有些分散。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 restful-authentication


    【解决方案1】:

    【讨论】:

    • 感谢您的链接...在这些页面中都找不到current_user
    【解决方案2】:

    我使用过 Restful-Authentication、Authlogic 和 Devise。根据 Rails 社区的反馈,我鼓励您查看 Devise。我最近将我的一个使用 Restful-Authentication 的 Rails 1.2.5 应用程序转换为使用 Devise 的 Rails 3.x 应用程序。使用 Devise 比使用 Restful-Authentication 容易得多。 (我知道这并不能直接回答你的问题,但我希望有人在我选择时告诉我。)

    【讨论】:

      猜你喜欢
      • 2011-11-28
      • 2013-08-21
      • 2011-07-06
      • 2011-10-02
      • 2014-11-15
      • 1970-01-01
      • 2021-02-16
      • 2012-03-14
      • 1970-01-01
      相关资源
      最近更新 更多