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

crispy-mobile

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crispy-mobile

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Crispy Mobile

What does it do?

Crispy Mobile empowers your Rails application with easy-accessible device-detection. In your controller or view, you can access device properties or add switches like:

- if device == :desktop
  = stylesheet_link_tag :desktop
- else
  = stylesheet_link_tag :mobile

= image_tag @photo.dynamic_url(device > :handheld_480 ? '600x400' : '300x200')

= image_tag @photo.dynamic_url("#{device.display_width}x")

Why should my app be responsive on the server side?

CSS media queries are nice. But not for mobile.

They just add up code you send to your clients instead of reducing it for mobile devices.

Imagine you want to make a responsive product page.

  • Do you really want to deliver a big 90KB product photo, if a 15KB photo would already fill the mobile screen?
  • Do you really want to compute personalized product recommendations if they are just hidden afterwards?
  • Do you really want mobile devices to download and interpret your whole stylesheet if half of the interface elements are going to be hidden anyway?

You don't.

If you start mobile-first, don't let your mobile performance be affected by additional desktop features.

Be kind, serve the clients exactly what they need.

How is it done?

A middleware is introduced which looks up the user agent string in the WURFL repository.

Usage

Pending. Please have a look at the source.

Installation

In your Gemfile add:

  gem 'crispy-mobile'

In your ApplicationController add:

  include Crispy::DeviceHelpers

License

See MIT-LICENSE.

FAQs

Package last updated on 18 Feb 2012

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