diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index caafdeab304d415c58b4b69f787c1cc0f958a90b..035bd64f5739a2be16947c0316fdf6312af75fe9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,9 +3,10 @@ # the COPYRIGHT file. class ApplicationController < ActionController::Base - #has_mobile_fu + has_mobile_fu protect_from_forgery :except => :receive + before_filter :mobile_except_ipad before_filter :set_contacts_and_status, :except => [:create, :update] before_filter :count_requests before_filter :set_invites @@ -25,6 +26,12 @@ class ApplicationController < ActionController::Base end end + def mobile_except_ipad + if is_mobile_device? + session[:mobile_view] = false if request.env["HTTP_USER_AGENT"].include? "iPad" + end + end + def count_requests @request_count = current_user.requests_for_me.size if current_user end diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index eddd63cd7fee40697b86c3de5e090a116ffa9320..be524275c0968c41ec514e4bb4b46aea165e8497 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -10,10 +10,9 @@ %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - = javascript_include_tag 'vendor/jquery144.min' - = javascript_include_tag 'vendor/jquery.mobile-1.0a1.js', 'rails' - = stylesheet_link_tag 'vendor/jquery_mobile.min' - = stylesheet_link_tag 'mobile' + = javascript_include_tag 'vendor/jquery144.min','rails' + = include_javascripts :mobile + = stylesheet_link_tag 'mobile', 'vendor/jquery_mobile.min' = csrf_meta_tag = yield(:head)