Searching by date

For the ruby side you can locate the month using the month() method on your date variable. For the SQL side look in the reference for BETWEEN. It's commonly associated with date range searching.

Naga harish Kanegolla wrote:

And/or, see if your db supplies a way to extract a month from a date, then select on that.

For example, you could do something like the following in mySql.

def whatever(month)    @products = Product.find(:all, :conditions => ['month(created_on) = ?', month] end

You get the idea.

Often that means you have a recursive infinite loop somewhere. I'd have to see the exact code though.