summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-02-21 15:45:43 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-02-21 15:45:43 -0800
commit882561f27f001ee0ee67ea43df422a87ef1c4944 (patch)
tree2eda75dbd9a5e72d5a73c019e9498066b4e8ad8d
parentHow about using function names that match markup functions... (diff)
downloadfrontend-882561f27f001ee0ee67ea43df422a87ef1c4944.tar.gz
frontend-882561f27f001ee0ee67ea43df422a87ef1c4944.tar.bz2
frontend-882561f27f001ee0ee67ea43df422a87ef1c4944.zip
More helper.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--lib/helpers.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/helpers.rb b/lib/helpers.rb
index fe0083a..e7050d1 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -1,5 +1,6 @@
require 'date'
require 'rinku'
+require 'erb'
helpers do
def list_check
@@ -35,6 +36,10 @@ helpers do
Rack::Utils.escape_html(text)
end
+ def u(text)
+ ERB::Util::url_encode(text)
+ end
+
def strip_email_domain(str)
str.gsub(/@(.*?)(>|$)/) do |s|
if $1 == 'gentoo.org'
@@ -64,4 +69,4 @@ helpers do
end
-end \ No newline at end of file
+end