Consultant to help me sort out how to query/report in Rails?

78 views
Skip to first unread message

BraveDave

unread,
May 11, 2007, 11:20:49 AM5/11/07
to Ruby Reports
Dear RubyReportist's
I've been beating up the Rails web forums for the last week trying to
understand how 'mature' Rails web developers' elect to allow their
users to 'mince' the data.
We all know that a normal INDEX action in Rails usually does a
Table.find(:all) and there we show the user a list (page by page) of
the 'whole show'.
Now, what happen's when the user wants to just see a part of it, or
sort by a field, or select a result set a group of separate fields?
I've seen code like this:
def self.search(town, beds, min_price, max_price)
conditions = []
conditions << ['town = ?', town] if town
conditions << ['beds = ?', beds] if beds
conditions << ['price >= ?', min_price] if min_price
conditions << ['price <= ?', max_price] if max_price
find(:all, :conditions => [conditions.transpose.first.join(' and '),
*conditions.transpose.last])
But not found anyone that can tie it all together. Are there any
people in this group that would be willing to consult to show me a
simple example of how this could be done?
David Kennedy
Dauntle...@gmail.com
775-885-9125

Gregory Brown

unread,
May 11, 2007, 11:27:47 AM5/11/07
to Ruby Reports

On May 11, 11:20 am, BraveDave <DauntlessDa...@gmail.com> wrote:
> Dear RubyReportist's
> I've been beating up the Rails web forums for the last week trying to
> understand how 'mature' Rails web developers' elect to allow their
> users to 'mince' the data.

Please do not post requests for assistance for things that are not
related to the Ruby Reports project on this list.

-greg

Reply all
Reply to author
Forward
0 new messages