Thank you for your help! I'm still learning how to use MVC, and I'm still
having difficulty with some of the concepts.

Can I ask a follow-up quesiton on how to set this up? I will have a product
that can belong to one or many sub-catagories which in turn belong to one or
many catagories. The same subcatagory name can belong to two different
catagories (although its referring to a different group of products). For
example: Fishingline (catagory) -> Long (subcatagory) and Knives (catagory)
-> Long (subcatagory), where the products in both are different.

Additional requirements:
- in the store, display just products in a subcatagory (under a catagory),
or display all products in the catagory (products belonging to all
subcatagories).
- in the admin portal, be able to set the catagories and subcatagories in
the product view

 So there needs to be a class to represent the catagories. Should there be a
class for each subcatagory that has the catagory as a property?

Can the products view update the catagory that the product belongs to?

For displaying in the store, I currently have a store controller + views
that display all of hte items. Can the store controller show the different
views based on the catagory? Or should the store controller own the catagory
buttons that direct to the catagory views that show the specific subset of
products? Do I need view and controller for the catagory class?

Thanks in advance for any advice you can provide!

Madison



On Tue, Aug 17, 2010 at 2:12 PM, Colin Law <[email protected]> wrote:

> On 17 August 2010 22:00, Madison Kelly <[email protected]> wrote:
> > I'm using an array to store a list of catagories that a product will
> belong
> > to. Since the number of catagories a product can belong to isn't set
> (could
> > be 1 or could be 10), I was going to use an array. Does that sound like
> an
> > appropriate use?
>
> No, I don't believe so.  Provide a Categories model and have product
> has_and_belongs_to_many categories (and vice versa).  Or provide a
> categories_products join table and use has_many through the join
> table.  See the Rails Guide on ActiveRecord Associations for more
> details.
>
> Colin
>
> --
>  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]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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.

Reply via email to