October 2009
1 post
Simple iPhone User Agent detection with Rails
There are a lot of methods for detecting user agents, but if you just want to use a different app layout in your rails app for iPhone users, here’s how we do it.
class ApplicationController < ActionController::Base
...
layout :application_layout
# detect UA for iPhone users
def application_layout
@browser_name ||= begin
ua =...