Displaying 1 result from an estimated 1 matches for "add_line_items_from_cart".
2007 Oct 26
1
post_via_redirect - testing problem
...#make a new object with the form data
@order = Order.create(:name => params[:name],
:address => params[:address],
:email => params[:email],
:pay_type => params[:pay_type])
@order.add_line_items_from_cart(@cart)
#if we saved the order, empty the cart and go back to index page
if @order.save
session[:cart] = nil
redirect_to_index("Thank you for your order")
else
#if it didn''t save, show the order form again
render :act...