retina_image_tag 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
|
|
1
1
|
module RetinaImageTag
|
2
2
|
module ViewHelpers
|
3
3
|
|
4
|
-
|
5
4
|
def retina_image( pixel_ratio )
|
6
5
|
@retina_image_path = image_path(@file_name+"@#{pixel_ratio}x"+@file_ext)
|
7
6
|
image_tag(@retina_image_path, @options)
|
@@ -11,10 +10,11 @@ module RetinaImageTag
|
|
11
10
|
def retina_image_tag(image, options = {})
|
12
11
|
@devicePixelRatio = cookies[:devicePixelRatio]
|
13
12
|
@options = options
|
13
|
+
@image = image # foo.jpg
|
14
14
|
|
15
|
-
@file_path = image_path(image)
|
16
|
-
@file_ext = File.extname(@file_path)
|
17
|
-
@file_name = File.basename(@
|
15
|
+
@file_path = image_path(@image)
|
16
|
+
@file_ext = File.extname(@file_path) # .jpg, .png
|
17
|
+
@file_name = File.basename(@image, @file_ext) # pic1, foo
|
18
18
|
@file_dirname = File.dirname(@file_path)
|
19
19
|
|
20
20
|
|