Colin Law wrote: > On 16 August 2010 17:10, Sam Kong <[email protected]> wrote: >>> category. >> >> Sorry. >> I was not clear about this. >> Product and Category are m:n relationship. >> Actually there's a Categoryship model. > > It would be easier if you could just supply the relationships. I > think you are saying category has_many products through categoryship > and product has_many categories through categoryship also. In that > case if you have a product then the categories are available as > @product.categories. I am not sure what your question is. >
You are understanding the relationships correctly. The problem is that @product.categories is multiple. I need to highlight only 1 category for the product and show only 1 breadcrumb. If there's some path that the user took, I can select the category but if there's no such context, I don't know what to do. I can make my own policy but I want to know how other developers are doing. Thanks. Sam -- Posted via http://www.ruby-forum.com/. -- 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.

