0

I have a rails app that uses bootstrap. It's meant to be used on mobile (it focuses heavily on geolocation from your phone's gps). I want to make the app accessible if you visit from your mobile device, but if you visit from your desktop/laptop/tablet, a message should appear stating that it's only meant for use on phones. Is this possible to do in Rails? Thanks!

dace
  • 5,819
  • 13
  • 44
  • 74

1 Answers1

1

Yes.

Mobile Fu is a rails gem that allows you to do this. You just need to check if the request is from a mobile device and subsequently render whatever you want to based on that. If you're on Rails 4 this might be helpful too.

Community
  • 1
  • 1
Mike S
  • 11,329
  • 6
  • 41
  • 76