Jameson,
If you prefer I might be able to answer on Google Hangout.
I have 2 possibilities for you.
The first is what comes out of the box.
The second is something I did to allow a product to be completely flexible on a contract I was on last year (unfortunately I have yetto donate that code back to the platform.
FIRST:
I think what you need is covered by product types. I would setup product types as follows:
"Men's" >> pants
"Men's" >> short sleeve shirts
"Men's" >> long sleeve shirts
"Men's" >> shoes
"Men's" >> outerwear
"Women's" >> pants
"Women's" >> short sleeve shirts
"Women's" >> long sleeve shirts
"Women's" >> shoes
"Women's" >> outerwear
"Girls" >> pants
"Girls" >> short sleeve shirts
"Girls" >> long sleeve shirts
"Girls" >> shoes
"Girls" >> outerwear
"Boys" >> pants
"Boys" >> short sleeve shirts
"Boys" >> long sleeve shirts
"Boys" >> shoes
"Boys" >> outerwear
Now if you look at the code in the product's controller you will see a filter based on the product_type_id. Basically if the product_type is Men's you will get all men's shirts/pants... but if the product type is Men's>>shirts you get just men's shirts.
class ProductsController < ApplicationController
def index
products = Product.active.includes(:variants)
product_types = nil
if params[:product_type_id].present? && product_type = ProductType.find_by_id(params[:product_type_id])
product_types = product_type.self_and_descendants.map(&:id)
end
if product_types
@products = products.where('product_type_id IN (?)', product_types)
else
@products = products.all
end
end
end
______________________________________
As for the other solution you will need to write some code:
First you can create two models:
Category and Categorizations.
class Categorization < ActiveRecord::Base
attr_accessible :categorizable_id, :categorizable_type, :category_id
belongs_to :category
belongs_to :categorizable , :polymorphic => true
end
class Category < ActiveRecord::Base
attr_accessible :active, :lft, :name, :parent_id, :rgt
acts_as_nested_set
extend FriendlyId
friendly_id :name, :use => :slugged
has_many :categorizations
has_many :products
end
and
class Product
has_many :categorizations, :as => :categorizable
has_many :categories, :through => :categorizations
###...... much more
def self.within_category(category)
category__ids = category.self_and_descendants.map(&:id)
includes(:categorizations).where('categorizations.category_id IN (?)', category__ids)
end
end
Finally
category = Category.find_by_id(params[:category_id])
products = Product.active.within_category(category)
That will allow you to "categorize" your product as men's >> Jeans or just "jeans" mixed with mens and women's
Hope that helps