...using
config.columns[:year_of_birth].search_ui = :date
and
config.columns[:year_of_birth].options = { :end_year =>
Date.today.year-100, :start_year => Date.today.year-5 }
Everything works as intended, ie upper and lower bound dates are set
using these options. But: What if I wanted to ease the users burden
and set :discard_day and :discard_month to true (so the user only has
to choose the years). Alas this doesnt work that simple: Performing
the search does not restrict the record set at all.
Pure speculation, as I dont have time right now to check the sources
thoroughly: Can it be that the forced :include_blank in field_search
selectors prevents date_selects default behaviour, i.e. :discard_xxx
true leaves xxx set to 1? Well, speculation aside, I would like to use
it this way (and actually set an upper and lower bound on the years of
birth search):
config.columns[:year_of_birth].options = { :discard_day =>
1, :discard_month => 1, :end_year => Date.today.year-100, :start_year
=> Date.today.year-5 }
Any hint how to achieve this?
Regards
Michael
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.