New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aaalex-detect_mobiles

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aaalex-detect_mobiles

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DetectMobiles

!!! Also detects iPhone and iPod Touch, now !!!

This plugin provides an instance method to ActionController::Base which can be used as a before_filter. The filter scans the request for indication of a mobile browser or an iPhone/iPod and then sets request.format to either :mobile or :iphone. This can be used in the responds_to block and in the views.

Usage Example

  • install the gem
  • add the MIME types to config/initializers/mime_types.rb Mime::Type.register_alias "text/html", :iphone Mime::Type.register_alias "text/html", :mobile
  • add the gem to your config/environment.rb -> config.gem "detect_mobiles"
  • add the before_filter to your controller

class ApplicationController < ActionController::Base before_filter :detect_mobiles end

now, the request.format will be changed to :mobile/:iphone depending on the browser.

Copyright (c) 2008 Alex P, released under the MIT license

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc