Sha256: 1b0e8b7f89055de45e14bfec659964372d5d2cbf82f4533f24d22d1436e148b7

Contents?: true

Size: 1.9 KB

Versions: 2

Compression:

Stored size: 1.9 KB

Contents

## Retina Rails [![Build Status](https://secure.travis-ci.org/jhnvz/retina_rails.png?branch=master)](http://travis-ci.org/jhnvz/retina_rails)

Makes your live easier optimizing an application for retina displays.

How it works
------------

Retina Rails automatically generates retina versions of your uploaded images (CarrierWave or Paperclip). It detects if a visitor has a retina display and if so it displays the @2x version.

Note: It also works for images that live in assets/images

Installation
------------

1. Add `gem 'retina_rails'` to your Gemfile.
1. Run `bundle install`.
1. Add `//= require retina` to your Javascript manifest file (usually found at `app/assets/javascripts/application.js`).

CarrierWave
------------

Add `include RetinaRails::CarrierWave` to the bottom of your uploader

```ruby
class ExampleUploader < CarrierWave::Uploader::Base

  version :small do
    process :resize_to_fill => [30, 30]
  end

  include RetinaRails::CarrierWave

end
```

Paperclip
------------

Add `include RetinaRails::Paperclip` to the bottom of your class

```ruby
class ExampleUploader < ActiveRecord::Base

  has_attached_file :image,
    :styles => {
       :original => ["800x800", :jpg],
       :big => ["125x125#", :jpg]
     }

  include RetinaRails::Paperclip

end
```

Voila! Now you're using Retina Rails.

Credits
------------

Retina Rails uses retinajs (https://github.com/imulus/retinajs)

Note on Patches/Pull Requests
------------

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

Copyright
------------

Copyright (c) 2012 Johan van Zonneveld. See LICENSE for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
retina_rails-0.0.3 README.md
retina_rails-0.0.2 README.md