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

12.16.2008
| 36352 views |
  • 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%>