The cost you should get when you get to the controller... Just send
the id of the product and find the cost when you get to the
controller...

About the quantity, not sure about the observer but I just added a
remote_form that has the quantity property:

<% remote_form_for :quantity, :url => { :controller =>
"carts", :action => :add, :id => @product.id },
        :complete => visual_effect(:highlight, 'floating_cart') do |f| -%>
        <%= f.select :quantity, (1..5) %>
        <%= image_submit_tag("../images/add_to_cart.png", :class =>
"submit_tag") %>
<% end %>


This is for the cart model... adding a product to the cart...
item.update_attributes({ :amount  => item.amount + quantity,
                         :price   => product.price,
                         :weight  => product.weight})
cart_items << item


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to