Check whether javascript and cookies are enabled in ruby on rails?

前端 未结 3 893
太阳男子
太阳男子 2021-01-13 06:08

I want to check whether javascript and cookies are enabled or not on page load in Ruby on Rails. So if anyone tries to open it, website should display a message that he cann

3条回答
  •  旧时难觅i
    2021-01-13 06:35

    If you need to know this server side, you can set a cookie through javascript. If rails can't read it, than the user doesn't have cookies or javascript enabled.

提交回复
热议问题