On Oct 10, 9:07 am, Jay Pangmi <[EMAIL PROTECTED]>
wrote:
> database. So I've also made Cart class but I have 'carts' table as well.
> So, I've used <%form_for :cart ....%> to get all the details from the
> form in one object and done @cart=find_cart(params[:cart]) and find_cart
> method as: (I'm not sure if its right way. I even don't know what
> exactly is happening between sessions table which was created via
> db:session:create and my 'carts' table.)
> ---------------------------------------------------------------------------
> -----
> def find_cart(cartobj)
> session[:cart] ||= Cart.new(cartobj)
> end
If carts are saved in the database I would just save its id in the
session. If this is all you're using here you're not actually saving
anything in the carts table at all.
> ---------------------------------------------------------------------------
> -----
>
> so far so good, details got saved but when it came to emptying the cart
> list, I'm confused what to do. Author has done it as:
Your would just retrieve the cart object and destroy it.
Fred
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---