Has anyone done controllers/views for filtering recordsets? I''m thinking along the lines of Tbird or Mail''s filtering rules. ___________________ Ben Jackson Diretor de Desenvolvimento +55 (21) 9997-0593 ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org http://www.incomumdesign.com
On Wednesday 22 June 2005 21:41, Ben Jackson wrote:> Has anyone done controllers/views for filtering recordsets? I''m > thinking along the lines of Tbird or Mail''s filtering rules.I''m using neither of the apps you mention, thus I may be completely off. If in a list view you want to display only rows matching certain criteria, given as comparison operators and filter values per column, then have a look at http://www.schuerig.de/michael/boilerplate/ If this is indeed (close to) what you''d like to have, then please wait a couple of days for the upcoming next release. Michael -- Michael Schuerig Not only does lightning not strike mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org twice, it usually doesn''t strike once. http://www.schuerig.de/michael/ --Salman Rushdie, Fury
Close but not quite :) Let me give a more fleshed-out example: I have two models, Answer and Person. I want my admin to be able to filter results like for example, "Show me all the answers to questions 1, 5 and 6 for people who are over 21, male and not from the UK." This means that I need to be able to have two rulesets, and add/subtract rules from the sets based on the model''s properties to construct the SQL query. This is a very advanced filtering interface, and as such I would expect that we''ll have to hack it ourselves. I''ll make sure to share my results when we get it working. Cheers, Ben On Jun 22, 2005, at 5:43 PM, Michael Schuerig wrote:> On Wednesday 22 June 2005 21:41, Ben Jackson wrote: >> Has anyone done controllers/views for filtering recordsets? I''m >> thinking along the lines of Tbird or Mail''s filtering rules. > > I''m using neither of the apps you mention, thus I may be completely > off. > If in a list view you want to display only rows matching certain > criteria, given as comparison operators and filter values per column, > then have a look at http://www.schuerig.de/michael/boilerplate/ > If this is indeed (close to) what you''d like to have, then please wait > a > couple of days for the upcoming next release. > > Michael > > -- > Michael Schuerig Not only does lightning not strike > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org twice, it usually doesn''t strike once. > http://www.schuerig.de/michael/ --Salman Rushdie, Fury > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Thursday 23 June 2005 04:32, Ben Jackson wrote:> Let me give a more fleshed-out example: > > I have two models, Answer and Person. I want my admin to be able to > filter results like for example, "Show me all the answers to > questions 1, 5 and 6 for people who are over 21, male and not from > the UK." This means that I need to be able to have two rulesets, and > add/subtract rules from the sets based on the model''s properties to > construct the SQL query.Constructing the SQL won''t be overly complicated as long as your filter conditions only refer to attributes of a single model class. When you need to take into account attributes of associated objects, Rails currently isn''t of much help. In that case you can''t just build the condition clauses but probably have to create the entire select statement yourself. Michael -- Michael Schuerig There is no matrix, mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org only reality. http://www.schuerig.de/michael/ --Lawrence Fishburn