Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor html helper

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