added email obfusticator to the helpers, use with #{to_html_email("user@domain.com")}

This commit is contained in:
B Mathis 2009-11-12 12:03:34 -06:00
parent a55a551566
commit 4d1e6d414c
1 changed files with 9 additions and 0 deletions

View File

@ -156,6 +156,15 @@ module Helpers
# My added helpers
def to_html_email(address)
email = string_to_html(address)
"<a href=\"#{string_to_html('mailto:')}#{email}\">#{email}</a>"
end
def string_to_html(s)
s.strip.unpack("C*").map{|ch| "&#" + ch.to_s + ";" }.to_s
end
def show_part (file)
data = ''
f = File.open(Dir.pwd+"/source/"+file)