Sha256: 0b122fe57bb3c2a6ec553a1f7f8d42d6821f7e2aa91123582297ef3b04641a03

Contents?: true

Size: 651 Bytes

Versions: 55

Compression:

Stored size: 651 Bytes

Contents

module ThinkFeelDoEngine
  module Concerns
    # Methods for browser type detection.
    module BrowserDetective
      extend ActiveSupport::Concern

      private

      # See http://richonrails.com/articles/action-pack-variants-in-rails-4-1
      def detect_browser
        case request.user_agent
        when /iPad/i
          request.variant = :tablet
        when /iPhone|Windows Phone/i
          request.variant = :phone
        when /Android/i && /mobile/i
          request.variant = :phone
        when /Android/i
          request.variant = :tablet
        else
          request.variant = :desktop
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.9 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.8 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.7 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.6 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.5 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.4 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.3 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.2 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.1 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.19.0 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.18.0 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.17.2 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.17.1 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.17.0 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.16.3 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.16.2 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.16.1 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.15.7 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.16.0 app/controllers/think_feel_do_engine/concerns/browser_detective.rb
think_feel_do_engine-3.15.6 app/controllers/think_feel_do_engine/concerns/browser_detective.rb