5. Detectar user agent app/controllers/application_controller.rb class ApplicationController < ActionController::Base before_filter :adjust_request_format_for_mobile_device layout "application" def index format.jqtouch {} end protected def adjust_request_format_for_mobile_device request.format = :jqtouch if request.user_agent =~ /iphone|ipod|ipad/i end end