Skip to content

Instantly share code, notes, and snippets.

@patrickberkeley
Created January 3, 2009 19:35
Show Gist options
  • Save patrickberkeley/42923 to your computer and use it in GitHub Desktop.
Save patrickberkeley/42923 to your computer and use it in GitHub Desktop.
def if_old(date)
"class_name_here" if !date.nil? && date < Date.today
end
<h1 class='<%= cycle("#{if_old(date)} odd", "#{if_old(date)} even") %>'>Some heading</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment