Sha256: 526b79a06e08ccff5f45aca5f4c56a0b97ca0d677226fd832caa5b4022850541

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

module RetinaImageTag
  module ViewHelpers
    def retina_image_tag(image)
       @file_path    = asset_path(image)
       @file_ext     = File.extname(@file_path)
       @file_name    = File.basename(@file_path, @file_ext)
       @file_dirname = File.dirname(@file_path)
     
       @devicePixelRatio = cookies[:devicePixelRatio]
     
       @normal_image_tag = image_tag(@file_path)
       @retina_image_path = @file_dirname+"/"+@file_name+"@2x"+@file_ext
     
       if @devicePixelRatio != '1'
         image_tag(@retina_image_path)
       else
         @normal_image_tag
       end
     end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
retina_image_tag-0.0.1 lib/retina_image_tag/view_helpers.rb