Skip to content

Instantly share code, notes, and snippets.

@toolmantim
Forked from lachlanhardy/new_plural.rb
Created September 26, 2010 10:25
Show Gist options
  • Save toolmantim/597809 to your computer and use it in GitHub Desktop.
Save toolmantim/597809 to your computer and use it in GitHub Desktop.
def pluralize(number, singular)
<<-HTML
<span class="#{singular.downcase}">
#{number}
<span>#{number == 1 ? singular : singular.pluralize}</span>
</span>
HTML
end
@toolmantim
Copy link
Author

the hyphen before the HTML on line 2 is unnecessary, but it kicks my textmate into syntax-highlighting the heredoc with the HTML bundle (which is friggin awesome BTW, works with any language!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment