Module: Vita::Html

Included in:
RenderingContext
Defined in:
lib/vita/html.rb

Instance Method Summary collapse

Instance Method Details

#h(text) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/vita/html.rb', line 9

def h(text)
  if text
    CGI.escape_html(text.to_s)
  else
    ""
  end
end


5
6
7
# File 'lib/vita/html.rb', line 5

def link_to(text, href)
  "<a href=\"#{h(href)}\">#{h(text)}</a>"
end