Time to Clean Your Filters

posted by andy, Fri Aug 14 08:47:00 UTC 2009

I always forget to clean or change the air filters in my house. By the time I pull them down they're a lint-filled mess. Unfortunately, filtering in your Rails code may end up the same way as your users layer in new ad hoc filtering requirements for your most important classes.

How do you handle filtering a list you've presented to a user, with all the combinations and permutations of user-driven ad hoc parameters? And how do you then layer sorting and paging on top of the filtered mess? Check out Filtering, sorting, paging... oh my! for some ideas on clean code to produce the results your users need without expanding the public API of your Rails app.

Filed Under: | Tags:

Comments