| ... | ... |
@@ -113,6 +113,15 @@ module Helpers |
| 113 | 113 |
|
| 114 | 114 |
# My added helpers |
| 115 | 115 |
|
| 116 |
+ def to_html_email(address) |
|
| 117 |
+ email = string_to_html(address) |
|
| 118 |
+ "<a href=\"#{string_to_html('mailto:')}#{email}\">#{email}</a>"
|
|
| 119 |
+ end |
|
| 120 |
+ |
|
| 121 |
+ def string_to_html(s) |
|
| 122 |
+ s.strip.unpack("C*").map{|ch| "&#" + ch.to_s + ";" }.to_s
|
|
| 123 |
+ end |
|
| 124 |
+ |
|
| 116 | 125 |
def show_part (file) |
| 117 | 126 |
data = '' |
| 118 | 127 |
f = File.open(Dir.pwd+"/source/"+file) |