small medium large xlarge

03 May 2009, 02:51
Kedar Mhaswade (21 posts)

Playtime on p. 134 has got an item that asks us to try adding an item in the cart by clicking on the item image. Well, it works when I use the form_remote_tag and image_submit_tag instead of image_tag.

But what happens is my images become bigger (maybe because image_submit_tag creates an input form field whereas image_tag creates an HTML img tag). I am not sure how I can control the size of the image (because there is no provision of something like :size on image_submit_tag).

Can someone help?

Regards, Kedar

06 May 2009, 17:18
James West (104 posts)

You should be controlling image sizes using CSS not HTMNL or ERB code. It may be that you need to adjust the css in the depot style sheet to account for a change in the tag name?

07 May 2009, 13:31
Kedar Mhaswade (21 posts)

Right. Someone on playtime suggested:

<%= image_submit_tag(product.image_url, :alt => product.title, :title => "Add to cart", :class => "product_picture") -%>

and then defining product_picture as a CSS class in depot.css.

You must be logged in to comment