Norm wrote: > 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")
ok thats great but how do I initiate that from the code. so for example the page will load index and collect the articles normally. but how do i then get it to collect the articles using the date filter code here!? sorry for such a noob question -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---