Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Mobile fu plus custom solution

#10

Hi,

Love your site. Question: Will mobile fu work with this solution?

class ApplicationController < ActionController::Base

protect_from_forgery

end

enable_mobile_fu

end

def check_for_mobile

session[:mobile_override] = params[:mobile] if params[:mobile]
prepare_for_mobile if mobile_device?

end

def prepare_for_mobile

prepend_view_path Rails.root + 'app' + 'views_mobile'

end

def mobile_device?

if session[:mobile_override]
  session[:mobile_override] == "1"
else
  # Season this regexp to taste. I prefer to treat iPad as non-mobile.
  (request.user_agent =~ /Mobile|webOS/) && (request.user_agent !~ /iPad/)
end

helper_method :mobile_device? end

Thanks,
Tony

Reported by Tony · January 10th, 2013 @ 08:51 AM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.