Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
到目前为止,我有:
authenticate_or_request_with_http_digest do |username,password| end
但我不知道如何传递这些值来设计返回/登录用户。
以下对我有用。
希望它可以帮助别人::::
before_filter :check_auth def check_auth authenticate_or_request_with_http_basic do |username,password| resource = User.find_by_email(username) if resource.valid_password?(password) sign_in :user, resource end end end