Using an AR Model to Specify and Store Complex Searches


#1

For a recent project I’ve had to create very complex search forms that
were core to the application. Because I wanted the ability to save
searches I decide that the search itself should be represented as a
model, but once I got done I really liked the solution. I’m looking
to turn a lot of the boilerplate into a plugin, but I want feedback
first to see how other people are tackling the problem. My writeup is
at
http://darwinweb.net/article/Implementing_Advanced_Search_In_Rails_Using_Search_Models

I welcome any feedback.


#2

Darwin,
I went to your link and found a long list of links, NONE describing
what you’re talking about?
I am very interested in learning and helping you with this technique
as I can see many places it’s needed.
David


#3

It’s right there! That’s a direct link to the article. The sidebar
links are old articles.


#4

Darwin, I have much ‘egg on my face’ this morning and appreciate your
patience in directing me to your article. I left a comment there and a
‘Thank you’ and wish to extend an offer to help ‘digest’ this
brilliant approach to the community. I see the HUGE hole in Rails as
it’s end user query options and feel you are the best thing for an
Enterprise solution.
David


#5

Thanks for the kind words. My blog is extremely basic and definitely
needs some interface work. Your comment did not come through,
probably because you have to Preview first in order to Save.

I still have quite a bit of work to bring this up to the level of
other Rails plugins I use every day. I’m surprised that I haven’t
been able to find anything out there like this, but I’m sure there’s a
lot of experience and patterns that smarter people than me are using
in this area. Once I finish the plugin I will post another message
here and hopefully will be able to garner some attention and provide a
robust solution.

I want to publically acknowledge Zach D. for creating
ActiveRecord::Extensions which makes hash-based conditions so much
more powerful.