I've been following the "Agile Web Development with Rails" book
shopping cart tutorial, and I've been trying to modify the checkout so
it lets me modify the quantity of items on checkout, so far I've added
a new action on the controler cart_checkout wich has the following
view:
<h2>Finish shopping</h2>
<% form_for :cart, @cart, :url => { :controller => 'store', :action =>
'cart_modify'} do |f| %>
<% @items.each do |item| %>
<p>
<%=h item.product.name%>
<%= text_field_tag item, item.quantity, { :size => 2, :maxlength
=> 3 } %>
</p>
<% end %>
<%= f.submit("Buy") %>
<% end %>
It displays a text field with the quantity, but when I try to read the
form on the controler, I don't know how to access each item and relate
it to its correspondig cart item in order to modify the quantity. Can
anyone point me in the right direction?.
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---