I have a partial, that generates a list of categories.  I'd like to
use the same partial for two different scenarios where data will be
coming from different models.  In one case, the partial is grabbing
category data directly from the Category model.  In another case it's
grabbing it from an associated UserCategory model.

Based on the associations, in one scenario, i'd display the category
name like this in the loop: category.name.  In the other scenario
(where I'm first retrieving category info through the UserCategory
model, I'd display it like: category.category.name.

What's the best way to use one partial for both situations?  Do I
alias category name somehow in the model so it can work for both
scenarios?

I look forward to your suggestions.

Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to