Dave Smith wrote:
> anyone know any examples of good code for a date range filter i can add
> to my app to return only selected articles within that range based on
> their created at date.
>
Here is how I fetch something similar. It is just a simple find.
Substitute the created_at field and it should work. Is that what you
are looking for?
@res = Reservation.find(:all,
:conditions => [ "enddate >= ? and startdate
<= ?",Date.today,Date.today+120],
:order => "space_id,startdate ASC")
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---