Forum: Ruby on Rails Design question - Selection Filters

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jake J. (Guest)
on 2005-11-30 01:21
Hello all-

I am implementing a database of items that link to vendors,
manufacturers, categories, and so on.  Since there could be thousands of
components within the database, I am now starting the task of building
up the logic for selection filters.

I think I would like to store the user's selection in the session, but
am wondering what should end up being stored.  For now, I'll assume i'm
always searching within one particular group (i.e., I'm looking for
items, not any combination of items, vendors, categories).  But the
filters could specify, say -- include the following categories, but
don't include these manufacturers.

Should it be layers of hashes with selection information which is then
translated into SQL just before the 'find' statement?  Or should I build
each "WHERE xxx" statement each time they add another selection filter
and concatenate them?

Can you point me to any good apps that lay out this sort of selection
process well?

Thanks much!
This topic is locked and can not be replied to.