Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor for readability

  • Loading branch information...
commit fc5813c825e54848a93e22635bf744b4a0f56ac1 1 parent afd53a5
Joe Fiorini authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/totally_tabular/html_helper.rb
View
5 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
Please sign in to comment.
Something went wrong with that request. Please try again.