Andrew says:

I changed this line:


<%= image_tag(product.image_url) %>

... to …


<%= link_to(image_tag(product.image_url), 
            line_items_path(:product_id => product), 
            html_options = {:method => :post}) %>

Arun says:

The above works fine, but when I click the image, it directs to line_items show action, instead of cart(http://localhost:3000/line_items?product_id=3). Andrew, did you face this? How to direct it to cart’s show action?