Permalink
Browse files

Refactor html helper

  • Loading branch information...
1 parent 6c0d531 commit 448e6c945240a7e51f5b2bea54283c1152dc02cc Joe Fiorini committed Jan 15, 2010
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/totally_tabular/html_helper.rb
@@ -1,14 +1,11 @@
module TotallyTabular
class HtmlHelper
+ EMPTY_TAG = /br|input|img/
def tag(tag, content="", attributes={})
case tag.to_s
- when "br"
- "<br>"
- when "input"
- "<input>"
- when "img"
- "<img>"
+ when EMPTY_TAG
+ "<%s>" % tag
when /^\w+$/
if attributes.any?
attr_string =

0 comments on commit 448e6c9

Please sign in to comment.