small medium large xlarge

25 Jan 2010, 23:35
alb3rtop (2 posts)

Hello, I need some help, please. I followed depot app and actually I’m basing my application on this.

I need only one help. My problem is that I have a menu based tree, and this menu has products and I want to add this products in differents carts.

Example: Suppose that you have posts and posts has many comments. You want to add to one cart comments of post_id = 1 and add to other cart comments with post_id = 2.

My initialization of my cart is:


def find_cart @cart = (session[:cart] ||= end

But I don’t want to initialize it with my session, only for what I said before.

I think in make carts belongs_to comment and comment has many carts but i don’t know how to make it with cart’s depot application.

Actually I have a cart that add comments of post_id = 1, post_id = 2.. together, and I want to separate this cart.

You must be logged in to comment