DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Karl has posted 1 posts at DZone. View Full User Profile

Link_to Image_tag Rails

  • submit to reddit
        // description of your code here
Create an image with URL in rails, and a button
    <%= link_to image_tag (product.image_url, :border =>0) ,:action  =>  :add_to_cart,  :id  =>  product %>
<%=  button_to "Add  to  Cart",  :action  =>  :add_to_cart,  :id  =>  product%>