aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-03-08 11:33:12 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-03-08 11:33:12 +1100
commit2dfdf876e88e881daff3c257adf266c6ce055175 (patch)
tree9d5a548c5027aa2f6a517b5f6f99d16154d85457
parent3b678881ab40c631b1653e816f2c741e539af86e (diff)
Extract helper for making an icon
-rw-r--r--app/helpers/admin_helper.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index 94db95611..ed6fc76e1 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -1,11 +1,19 @@
-module AdminHelper
+module AdminHelper
+ def icon(name)
+ content_tag(:i, "", :class => "icon-#{name}")
+ end
+
+ def eye_icon
+ icon("eye-open")
+ end
+
def request_both_links(info_request)
- link_to('<i class="icon-eye-open"></i>'.html_safe, request_path(info_request)) + " " +
+ link_to(eye_icon, request_path(info_request)) + " " +
link_to(info_request.title, admin_request_show_url(info_request))
end
def public_body_both_links(public_body)
- link_to('<i class="icon-eye-open"></i>'.html_safe, public_body_url(public_body)) + " " +
+ link_to(eye_icon, public_body_url(public_body)) + " " +
link_to(h(public_body.name), admin_body_show_path(public_body))
end