On one of my pages, I''m listing items by date. What I''d like to do is change the formatting when the month changes. What''s a good way to do this? I''ve read the bit about partials to cycle through formatting for alternate rows, but what about arranging it by month? Example: <In format 1> Sep 23 Sep 12 Sep 1 <In format 2> Aug 12 Aug 4 <In format 3> Jul 31 Jul 25 <<Prev Page>> | <<Next Page >> Thanks, Mohit. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
To alternate back and forth based on month <div class="month<%= [month number]%2).to_s %>"> That will return either "month0" or "month1". Then set the styles for .month0 and .month1 in your css That Mohit Sindhwani wrote:> On one of my pages, I''m listing items by date. What I''d like to do is > change the formatting when the month changes. What''s a good way to do > this? I''ve read the bit about partials to cycle through formatting for > alternate rows, but what about arranging it by month? > > Example: > > <In format 1> > Sep 23 > Sep 12 > Sep 1 > <In format 2> > Aug 12 > Aug 4 > <In format 3> > Jul 31 > Jul 25 > > <<Prev Page>> | <<Next Page >> > > > Thanks, > Mohit. > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---