Rails Browser Detection Methods

前端 未结 3 1497
春和景丽
春和景丽 2020-11-30 05:18

Hey Everyone, I was wondering what methods are standard within the industry to do browser detection in Rails? Is there a gem, library or sample code somewhere that can help

3条回答
  •  难免孤独
    2020-11-30 06:12

    Try request.env['HTTP_USER_AGENT'], this will return your client's User Agent. There's also a quick helper posted by Hubert Łępicki

提交回复
热议问题