Then you use string matching to map the user agent string to an Enum called Agents.
然后,您使用字符串机器将这个用户代理字符串映射到一个名为agents的Enum。
The mechanism chosen, which is not the only possible way to manage this, involves creating a pseudo-MIME type, matching the user-agent string and using Rails' respond_to mechanism.
所选用的机制(并不是惟一的实现方法)涉及创建伪 MIME 类型,匹配用户代理字符串和使用 Rails 的 respond_to 机制。
应用推荐