I have used ransack, but what you are looking for is not directly
implemented.

You have two options:
1) Use a database specific syntax such as EXTRACT
2) Create a predicate (see github readme) which will which that the
date is greater then or eq to 1/1/2011 00:00:00 and less then 1/1/2012
00:00:00

You can see the built-in predicates here:
https://github.com/ernie/ransack/blob/master/lib/ransack/constants.rb


On Oct 19, 8:07 am, Mauro <[email protected]> wrote:
> I'm using ransack for my searches.
> I need to search through date fields but only for year.
> For example I need all documents created in 2011.
> For those that use ransack, there such a way to do this?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to