In my products#show view I have the following:

<div id="product-images" data-hook="product_images">
<div id="main-image" data-hook>
<%= render :partial => 'image' %>
</div>
<div id="thumbnails" data-hook>
<%= render :partial => 'thumbnails' %>
</div>
</div>

And then in the _image.html.erb partial i have the following:

<% if image %>
<%= image_tag image.attachment.url(:large), :itemprop => "image" %>
<% else %>
<%= product_image(@product, :itemprop => "image") %>
<% end %>

However, my images aren't resizing to the dimensions set to :large in the
paperclip configuration. I've tried setting it to other sizes and it just
won't change. I've already reset the paperclip styles with the rake
function, rake paperclip:refresh:thumbnails CLASS=Spree::Image

Any ideas? Thanks!

--
Don't miss SpreeConf on May 20-21: http://spreeconf.com
Spree is hiring: http://spreecommerce.com/careers

Search Discussions

  • Ryan Bigg at Apr 24, 2013 at 12:49 am
    Hi Jameson,


    Can you please provide some exact steps to reproduce this issue so that I can try it out on my machine? The steps need to be very specific so that I can ensure I'm seeing exactly what you are. Imagine what the steps would be like if you had to try and reproduce this issue yourself.


    Thanks!

    On Wed, Apr 24, 2013 at 8:03 AM, Jameson Trinker
    wrote:
    In my products#show view I have the following:
    <div id="product-images" data-hook="product_images">
    <div id="main-image" data-hook>
    <%= render :partial => 'image' %>
    </div>
    <div id="thumbnails" data-hook>
    <%= render :partial => 'thumbnails' %>
    </div>
    </div>
    And then in the _image.html.erb partial i have the following:
    <% if image %>
    <%= image_tag image.attachment.url(:large), :itemprop => "image" %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>
    However, my images aren't resizing to the dimensions set to :large in the
    paperclip configuration. I've tried setting it to other sizes and it just
    won't change. I've already reset the paperclip styles with the rake
    function, rake paperclip:refresh:thumbnails CLASS=Spree::Image
    Any ideas? Thanks!
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Matthew Ford at Apr 24, 2013 at 10:44 am
    @Jameson, whats in public/system/paperclip_attachments.yml ?
    On Wednesday, 24 April 2013 02:12:43 UTC+1, Jameson Trinker wrote:

    I'm pretty much using the default spree settings, but I'll walk you
    through what I'm doing. I log into the spree admin section, go to the
    'configuration' tab, click 'image settings', and under paperclip styles I
    clicked 'Add new style', and named it 'large'.

    Then in the 'show' action of my 'products' controller, I have the
    following code:

    <div data-hook="product_show">
    <% @body_id = 'product-details' %>
    <h1><%= accurate_title %></h1>


    <div id="product-images" data-hook="product_images">
    <div id="main-image" data-hook>
    <%= render 'image' %>
    </div>
    <div id="thumbnails" data-hook>
    <%= render 'thumbnails', :product => @product %>
    </div>
    </div>


    <div id="cart-form" data-hook="cart_form">
    <%= render 'cart_form' %>
    </div>


    <div id="product-description" data-hook="product_description">
    <%= product_description(@product) rescue t(:product_has_no_description) %>
    <div data-hook="product_properties">
    <%= render 'properties' %>
    </div>
    </div>
    </div>

    <%= render 'taxons' %>

    Which is just the default 'products#show' code. On my products#show page I am displaying a large image of the product, just like
    spree's default product page is laid out. However, I would like the default main product image to be larger. Therefore, I went into the partial '_image.html.erb', which is being rendered by 'products#show' and changed the following code:

    <% if image %>
    <%= image_tag image.attachment.url(:product) %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>

    to this:

    <% if image %>
    <%= image_tag image.attachment.url(:large) %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>

    essentially just changing ':product' to ':large', but nothing changes.


    I tried changing the size in other places in the app and it worked. For example, in the

    _products.html.erb partial I have this code:

    <!-- BRINGS THUMBNAILS INTO TAXONS PAGE -- PULLED FROM _THUMBNAILS.HTML.ERB -->
    <div class="product-images" data-productid="<%= product.id %>">
    <% if (product.images + product.variant_images).uniq.size > 1 %>
    <ul id="product-thumbnails-taxon" class="thumbnails inline" data-hook>
    <% product.images.each do |i| %>
    <li class='tmb-all' id='tmb-<%= i.id %>'>
    *<%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:normal), :class => 'tmb-all', :id => "tmb-#{i.id}") %>*
    </li>
    <% end %>
    </ul>
    <% end %>
    </div><!-- product-images -->
    <!-- END THUMBNAILS INTO TAXONS PAGE -->

    And I switched around the sizes from :mini and :normal to something else and it worked fine.

    Thanks very much for your help. Let me know if I can give you more information.



    On Tue, Apr 23, 2013 at 7:49 PM, Ryan Bigg <ry...@spreecommerce.com<javascript:>
    wrote:
    Hi Jameson,

    Can you please provide some exact steps to reproduce this issue so that I
    can try it out on my machine? The steps need to be very specific so that I
    can ensure I'm seeing exactly what you are. Imagine what the steps would be
    like if you had to try and reproduce this issue yourself.

    Thanks!


    On Wed, Apr 24, 2013 at 8:03 AM, Jameson Trinker <jameson...@gmail.com<javascript:>
    wrote:
    In my products#show view I have the following:

    <div id="product-images" data-hook="product_images">
    <div id="main-image" data-hook>
    <%= render :partial => 'image' %>
    </div>
    <div id="thumbnails" data-hook>
    <%= render :partial => 'thumbnails' %>
    </div>
    </div>

    And then in the _image.html.erb partial i have the following:

    <% if image %>
    <%= image_tag image.attachment.url(:large), :itemprop => "image" %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>

    However, my images aren't resizing to the dimensions set to :large in
    the paperclip configuration. I've tried setting it to other sizes and it
    just won't change. I've already reset the paperclip styles with the rake
    function, rake paperclip:refresh:thumbnails CLASS=Spree::Image

    Any ideas? Thanks!

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Jameson Trinker at Apr 24, 2013 at 1:57 pm
    I don't think that directory even exists. Other than 404 and other error
    pages I just have a directory called spree inside public, which has a
    products and taxons directory. What does that file do?
    On Wednesday, April 24, 2013 5:35:46 AM UTC-5, Matthew Ford wrote:

    @Jameson, whats in public/system/paperclip_attachments.yml ?
    On Wednesday, 24 April 2013 02:12:43 UTC+1, Jameson Trinker wrote:

    I'm pretty much using the default spree settings, but I'll walk you
    through what I'm doing. I log into the spree admin section, go to the
    'configuration' tab, click 'image settings', and under paperclip styles I
    clicked 'Add new style', and named it 'large'.

    Then in the 'show' action of my 'products' controller, I have the
    following code:

    <div data-hook="product_show">
    <% @body_id = 'product-details' %>
    <h1><%= accurate_title %></h1>


    <div id="product-images" data-hook="product_images">
    <div id="main-image" data-hook>
    <%= render 'image' %>
    </div>
    <div id="thumbnails" data-hook>
    <%= render 'thumbnails', :product => @product %>
    </div>
    </div>


    <div id="cart-form" data-hook="cart_form">
    <%= render 'cart_form' %>
    </div>


    <div id="product-description" data-hook="product_description">
    <%= product_description(@product) rescue t(:product_has_no_description) %>
    <div data-hook="product_properties">
    <%= render 'properties' %>
    </div>
    </div>
    </div>

    <%= render 'taxons' %>

    Which is just the default 'products#show' code. On my products#show page I am displaying a large image of the product, just like
    spree's default product page is laid out. However, I would like the default main product image to be larger. Therefore, I went into the partial '_image.html.erb', which is being rendered by 'products#show' and changed the following code:

    <% if image %>
    <%= image_tag image.attachment.url(:product) %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>

    to this:

    <% if image %>
    <%= image_tag image.attachment.url(:large) %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>

    essentially just changing ':product' to ':large', but nothing changes.


    I tried changing the size in other places in the app and it worked. For example, in the

    _products.html.erb partial I have this code:

    <!-- BRINGS THUMBNAILS INTO TAXONS PAGE -- PULLED FROM _THUMBNAILS.HTML.ERB -->
    <div class="product-images" data-productid="<%= product.id %>">
    <% if (product.images + product.variant_images).uniq.size > 1 %>
    <ul id="product-thumbnails-taxon" class="thumbnails inline" data-hook>
    <% product.images.each do |i| %>
    <li class='tmb-all' id='tmb-<%= i.id %>'>
    *<%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:normal), :class => 'tmb-all', :id => "tmb-#{i.id}") %>*
    </li>
    <% end %>
    </ul>
    <% end %>
    </div><!-- product-images -->
    <!-- END THUMBNAILS INTO TAXONS PAGE -->

    And I switched around the sizes from :mini and :normal to something else and it worked fine.

    Thanks very much for your help. Let me know if I can give you more information.


    On Tue, Apr 23, 2013 at 7:49 PM, Ryan Bigg wrote:

    Hi Jameson,

    Can you please provide some exact steps to reproduce this issue so that
    I can try it out on my machine? The steps need to be very specific so that
    I can ensure I'm seeing exactly what you are. Imagine what the steps would
    be like if you had to try and reproduce this issue yourself.

    Thanks!

    On Wed, Apr 24, 2013 at 8:03 AM, Jameson Trinker wrote:

    In my products#show view I have the following:

    <div id="product-images" data-hook="product_images">
    <div id="main-image" data-hook>
    <%= render :partial => 'image' %>
    </div>
    <div id="thumbnails" data-hook>
    <%= render :partial => 'thumbnails' %>
    </div>
    </div>

    And then in the _image.html.erb partial i have the following:

    <% if image %>
    <%= image_tag image.attachment.url(:large), :itemprop => "image" %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>

    However, my images aren't resizing to the dimensions set to :large in
    the paperclip configuration. I've tried setting it to other sizes and it
    just won't change. I've already reset the paperclip styles with the rake
    function, rake paperclip:refresh:thumbnails CLASS=Spree::Image

    Any ideas? Thanks!

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Jameson Trinker at Apr 24, 2013 at 3:26 pm
    I figured it out. I have to append the paperclip style _image tag, such as

    <%= large_image(@product, :itemprop => "image") %>

    or

    <%= mini_image(@product, :itemprop => "image") %>

    Do you know why this is? How come changing the :large in

    <%= image_tag image.attachment.url(:large), :itemprop => "image" %>

    is ineffective?

    Thanks!
    On Tuesday, April 23, 2013 5:03:50 PM UTC-5, Jameson Trinker wrote:

    In my products#show view I have the following:

    <div id="product-images" data-hook="product_images">
    <div id="main-image" data-hook>
    <%= render :partial => 'image' %>
    </div>
    <div id="thumbnails" data-hook>
    <%= render :partial => 'thumbnails' %>
    </div>
    </div>

    And then in the _image.html.erb partial i have the following:

    <% if image %>
    <%= image_tag image.attachment.url(:large), :itemprop => "image" %>
    <% else %>
    <%= product_image(@product, :itemprop => "image") %>
    <% end %>

    However, my images aren't resizing to the dimensions set to :large in the
    paperclip configuration. I've tried setting it to other sizes and it just
    won't change. I've already reset the paperclip styles with the rake
    function, rake paperclip:refresh:thumbnails CLASS=Spree::Image

    Any ideas? Thanks!
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedApr 23, '13 at 10:04p
activeApr 24, '13 at 3:26p
posts5
users3
websitespreecommerce.com
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase