Hi,

I have a model with an only one (exclusive) category and several
possible sub_categories. The sub_categories are stored into a string
on the AR model and are just comma-separated. I'm able to filter
properly with both categories and sub-categories.

Now when a category is selected, I need to retrieve the available sub-
categories to fill a select-box, basically. I found out that this was
working, thanks to the facets feature:

Item.facets(:conditions => { :category => 'SomeTopic' })
[:sub_categories].keys.join(',').split(',').uniq.sort

Do you have any idea of some cleaner version, maybe using some built-
in feature I'm not aware of ?

thanks for any hint,

-- Thibaut
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" 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/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to