Displaying 1 result from an estimated 1 matches for "check_mobile".
2011 May 21
4
request.format = :mobile causes error "undefined method `ref' for nil:NilClass"
...stMobile::Application.routes.draw do
root :to => "application#welcome"
end
application_controller.rb __________________________
class ApplicationController < ActionController::Base
protect_from_forgery
def welcome
render "welcome/index"
end
before_filter :check_mobile
def check_mobile
request.format = :mobile if request.env["HTTP_USER_AGENT"] =~ /
iPhone/
end
end
views/welcome/index.html.erb ______________________________________
this is my regular site
views/welcome/index.mobile.erb ____________________________________
this is my mob...