My company is looking at redoing our legacy Classic ASP storefront, and I'm thinking about doing it in Rails since the alternative is to use a PHP-based solution called Magento that, while it looks nice, is insanely abstract to the point of making me go blind (it uses a database design principle called Entity-Attribute-Value or EAV which basically is to keep database tables like hashmaps that can contain an infinite number of values).
The principle requirement of this site is to be able to filter certain products based on the subdomain, since we want to have different "brands". The products aren't specific to this subdomain, but the subdomain only shows a subset of products. For example: www.mysite.com: displays all products with categories/subcategories (i.e. no filtering) furniture.mysite.com: displays only products/subcategories with a parent category of furniture green.mysite.com: displays only products/categories/subcategories with a (boolean) flag recycled = true How would I go about doing this? The only way I can think would be to have separate controllers for each "store", for example: # Main store i.e. no subdomain class StoreController < ApplicationController def index @products = Products.find(:all) end end # furniture.mysite.com class FurnitureStoreController < ApplicationController def index @products = Products.find_all_by_category('Furniture') end end # green.mysite.com class GreenStoreController < ApplicationController def index @products = Products.find_all_by_recycled(true) end end But that seems rather unweildy. This is a critical business requirement since we want to create different stores with their own unique look and feel, but the actual data displayed comes from one master database and needs to be filtered appropriately based on the store the user is browsing. Another critical requirement we have is that each individual product can have up to four prices, and the price is chosen based on the "store" the user is viewing it on (e.g. Product A is $15.00 on the mysite.com, but $12.00 on furniture.mysite.com). I'm not sure what the best way to tackle that problem would be. Any assistance with either or both of these issues would be greatly appreciated! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---