acts-as-shopping-cart

Using acts_as_shopping_cart how do I implement basic quantity editing?

纵饮孤独 提交于 2019-11-29 18:09:21
The acts_as_shopping_cart gem requires two models - Shopping Cart and Shopping Cart Item . The attributes it allows you to access like this for the item: <td><%= shopping_cart_item.item.name %></td> <td><%= shopping_cart_item.item.price %></td> <td><%= shopping_cart_item.quantity %></td> But I want to allow users to change the quantity - from say a drop-down menu (so a select tag from a collection). But I am not quite sure how to approach that. I would also like to add other attributes to my item - like a size of an item, color, etc. I would like my store owner to be able to specify those

Using acts_as_shopping_cart how do I implement basic quantity editing?

北城以北 提交于 2019-11-28 12:23:00
问题 The acts_as_shopping_cart gem requires two models - Shopping Cart and Shopping Cart Item . The attributes it allows you to access like this for the item: <td><%= shopping_cart_item.item.name %></td> <td><%= shopping_cart_item.item.price %></td> <td><%= shopping_cart_item.quantity %></td> But I want to allow users to change the quantity - from say a drop-down menu (so a select tag from a collection). But I am not quite sure how to approach that. I would also like to add other attributes to my