Simple redirects with rdrctor.com

Your DNS provider doesn’t support Forward records? You don’t have the ability to add a .htaccess file? No access to your ngnix or apache config? Tired of setting up domain redirects from your code? You don’t have to anymore!

All you have to do is setup an account at rdrctor.com and create your first redirect.

After creating your redirect make sure to point your dns to rdrctor.com and use one of the following options:

Record Target
CNAME rdrctor.com
ALIAS or ANAME rdrctor.com
A 184.73.160.229

Retina Rails version bump

In version 2.0.0 we got rid of double image uploads and and the javascript helper. Retina Rails now displays high-resolution images by default instead of swapping the low-res image with a high-res version. This will save up on requests and storage.


Upgrading

Since the whole strategy for displaying images has changed there are some things you need to do for version 2.0.0 to work.

Javascript helper

Remove //= require retina from your Javascript manifest file (usually found at app/assets/javascripts/application.js) since we don’t need it anymore.

Migrations

You’ll need to add a retina_dimensions column to the table of every model using retina optimised image uploads.

For example: class AddRetinaDimensionsColumnToUsers < ActiveRecord::Migration def self.change add_column :users, :retina_dimensions, :text end end

Displaying images

Instead of rendering images with the image_tag method we now render with retina_image_tag.

Old way: image_tag(@user.image.url(:small), :retina => true)

New way: retina_image_tag(@user, :image, :small, :default => [50, 40]) retina_image_tag(@user, :image, :small, :default => { :width => 50, :height => 40 })

Reprocessing uploads

Since we only store the retina optimised version we need to save the original dimensions of the uploaded image. Every uploaded image needs to be reprocessed.

Carrierwave

Open up a console and run: Model.find_each do |model| model.image.recreate_versions! end Or create a rake task that will do the trick for you.

Paperclip

Run: rake paperclip:refresh


Make sure to run a test on your local machine or your staging environment before deploying to a production environment.

For more info check the repository.