diff --git a/app/helpers/image_helper.rb b/app/helpers/image_helper.rb new file mode 100644 index 0000000..6717349 --- /dev/null +++ b/app/helpers/image_helper.rb @@ -0,0 +1,5 @@ +module ImageHelper + def image_thumb(image, size) + image.thumb(size).encode("jpg", "-quality 90") + end +end diff --git a/app/views/images/_image.html.erb b/app/views/images/_image.html.erb new file mode 100644 index 0000000..43a3604 --- /dev/null +++ b/app/views/images/_image.html.erb @@ -0,0 +1,17 @@ + + " + media="(min-width: 960px) and (-webkit-min-device-pixel-ratio: 2), + (min-width: 960px) and (min-resolution: 192dpi)"> + " + media="(min-width: 960px)"> + " + media="(min-width: 640px) and (-webkit-min-device-pixel-ratio: 2), + (min-width: 640px) and (min-resolution: 192dpi)"> + " + media="(min-width: 640px)"> + " + media="(-webkit-min-device-pixel-ratio: 2), + (min-resolution: 192dpi)"> + "> + " itemprop="image"> + diff --git a/app/views/images/show.html.erb b/app/views/images/show.html.erb index 9c9157c..7d3aa0e 100644 --- a/app/views/images/show.html.erb +++ b/app/views/images/show.html.erb @@ -6,7 +6,7 @@
- <%= image_tag(@image.image.url) %> + <%= render "image", image: @image %>