I'm using squeel, and I have a search method in my Event.rb model, which receives a parameter(string) from a text_field input
def self.search(search)
if search
self.where{date.month.strftime("%B").matches("%#{search}%")}
else
find(:all)
end
end
What I'm trying to accomplish is, if the user enters "fe" or "ap" search in the Event.date.month for a match ("february", "april", etc). At the moment is working only entering the month number 02, 04, etc.
I'd appreciate any help