Skip to content

Instantly share code, notes, and snippets.

@mattd
Created April 26, 2011 14:33
Show Gist options
  • Save mattd/942362 to your computer and use it in GitHub Desktop.
Save mattd/942362 to your computer and use it in GitHub Desktop.
# BAD
{hosts, [<% @domains.each_with_index do |domain, i| -%>"<%= domain %>"<% if i == @domains.length - 1 -%>, <% end -%><% end -%>]}.
# GOOD
{hosts, [<% @domains.map! { |domain| "\"#{domain}\"" } -%><%= @domains.join(", ") %>]}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment