I’m trying to conditionally render/hide some html in one of my views for tablets and mobile devices such as android phones & tablets, iPhone, iPad, etc. So far I have this setup:
def mobile_agent?
request.user_agent =~ /Mobile|webOS/
end
This seems to work good, but currently it only supports mobile devices and not tablets. I know mobile_fu groups both mobile devices and tablets under the mobile device category, however it also changes the request format which I don’t want. My web application is utilizing a responsive theme so views are meant to work under any device with the exception of an embeded Unity webplayer which I wish to hide in a single view.
Is there any way I can extend the above method to include tablets as well as mobile devices?
I use this one