Hello, How do you handle advanced searches in Rails, i.e., anything more than one field? I searched the archives but wasn''t able to find a good example of this. [I also noticed the forum itself has no advanced search yet!] This is another of those common scenarios--like advanced lookup functionality--that I''d address if I was inventing a Web framework. I''ve been re-reading the Agile Rails book but couldn''t find a discussion of search functionality ("search" also isn''t listed in the index). I''m sure people are building search functionality and I''m just missing something! -- Posted via http://www.ruby-forum.com/.
Mike wrote:> Hello, > > How do you handle advanced searches in Rails, i.e., anything more than > one field? >find_all_by_fielda_and_fieldb(vala,valb) will do it. If it''s more complex, you can use: find(:all, :conditions => [''foo=? and bar!=?'', [vala, valb]]) -- Alex
Hey Alex, Thanks. I may be making this more complicated than it needs to be in Rails. -- Posted via http://www.ruby-forum.com/.
I''m a newbie but I think that is what Ferret is for. On 1/27/06, Mike <no@spam.com> wrote:> Hello, > > How do you handle advanced searches in Rails, i.e., anything more than > one field? > > I searched the archives but wasn''t able to find a good example of this. > [I also noticed the forum itself has no advanced search yet!] > > This is another of those common scenarios--like advanced lookup > functionality--that I''d address if I was inventing a Web framework. > > I''ve been re-reading the Agile Rails book but couldn''t find a discussion > of search functionality ("search" also isn''t listed in the index). > > I''m sure people are building search functionality and I''m just missing > something! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Greg Freemyer The Norcross Group Forensics for the 21st Century