Permalink
Browse files

Refactor for readability

  • Loading branch information...
1 parent afd53a5 commit fc5813c825e54848a93e22635bf744b4a0f56ac1 Joe Fiorini committed Jan 15, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/totally_tabular/html_helper.rb
@@ -3,10 +3,9 @@ class HtmlHelper
EMPTY_TAG = /br|input|img/
def tag(tag, content="", attributes={})
- case tag.to_s
- when EMPTY_TAG
+ if tag.to_s =~ EMPTY_TAG
"<%s%s>" % [tag, attrs(attributes)]
- when /^\w+$/
+ else
"<%s%s>%s</%s>" % [tag, attrs(attributes), content, tag]
end
end

0 comments on commit fc5813c

Please sign in to comment.