Nitobi
About Nitobi
Services
Products
Home -> Blogs -> Brian@Nitobi

Brian@Nitobi

Ruby case statements in ERB

March 14th, 2008

Fail spectacularly if you happen to indent incorrectly (but not intuitively). Thankfully, Jamis Buck points out a simple solution on the Ruby mailing list:


<% case number
when 1 %>
one
<% when 2 %>
two
<% else %>
something else
<% end %>

Thank you Jamis!

| Del.icio.us

This entry was posted on Friday, March 14th, 2008 at 4:29 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply


Search Posts

Pages

Archives

Categories

All contents are (c) Copyright 2006, Nitobi Software Inc. All rights Reserved
Brian@Nitobi Entries (RSS) and Comments (RSS).