I have a simple model structure. Projects have many notes. For each of my project pages I would like to have a simple display like the following: Project Name Week of MM/DD/YYYY Notes that fall under that week So the output would be like the following: Test Project (project.name) 10/08/2007 (note.created_on) - Test (note.body) - Test 2 10/01/2007 - Test 3 Any thoughts on how I can craft an ActiveRecord :find to appropriately group my notes by date by project like this? Thanks! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If all else fails, go to the source and learn the algorithm to convert a date to a week number: http://www.amazon.com/Calendrical-Calculations-Millennium-Edward-Reingold/dp/0521777526 Matthew Williams wrote: ...> > Any thoughts on how I can craft an ActiveRecord :find to appropriately > group my notes by date by project like this? > > Thanks!-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---