X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=app%2Fviews%2Fstore%2Findex.html.erb;h=7bbc2abaad5eab95d8f72a1d949edc92443cb10e;hb=128ba7d3b10ef93d000a3f6105c09129bf84b991;hp=1ed17dd5e287aec1af5b7c85ad68c70656c0f43a;hpb=6af7ab424668bc5dce20630e1b112bc611edab63;p=depot.git diff --git a/app/views/store/index.html.erb b/app/views/store/index.html.erb index 1ed17dd..7bbc2ab 100644 --- a/app/views/store/index.html.erb +++ b/app/views/store/index.html.erb @@ -2,12 +2,17 @@ <% for product in @products -%>
- <%= image_tag(product.image_url) %> -

<%=h product.title %>

+ <% form_remote_tag :url => {:action => 'add_to_cart', :id => product} do %> + <%= image_submit_tag(product.image_url) %> + <% end %> +

<%= h(product.title) %>

<%= product.description %>
- <%= number_to_currency product.price, :unit => "£" %> - <%= button_to "Add to cart" %> + <%= number_to_currency product.price, :unit => "£" %> + <% form_remote_tag :url => {:action => 'add_to_cart', :id => product} do %> + <%= submit_tag "Add to cart" %> + <% end %>
<% end %> +