... | ... |
@@ -156,6 +156,15 @@ module Helpers |
156 | 156 |
|
157 | 157 |
# My added helpers |
158 | 158 |
|
159 |
+ def to_html_email(address) |
|
160 |
+ email = string_to_html(address) |
|
161 |
+ "<a href=\"#{string_to_html('mailto:')}#{email}\">#{email}</a>" |
|
162 |
+ end |
|
163 |
+ |
|
164 |
+ def string_to_html(s) |
|
165 |
+ s.strip.unpack("C*").map{|ch| "&#" + ch.to_s + ";" }.to_s |
|
166 |
+ end |
|
167 |
+ |
|
159 | 168 |
def show_part (file) |
160 | 169 |
data = '' |
161 | 170 |
f = File.open(Dir.pwd+"/source/"+file) |