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.
我正在使用 private_pub gem 进行聊天。当我使用用户的 email_is 作为自定义频道名称时,它会引发无效频道错误。我如何使用 email_id 作为频道名称?
频道是这样的url路径"/messages/new"
"/messages/new"
所以你希望网址是"/messages/:id/new"
"/messages/:id/new"
其中 :id = 您的电子邮件。
但是,您必须先转义电子邮件或像这样散列它:
CGI.escape email_address # to escape characters
Digest::SHA1.hexdigest email_address # to convert to SHA