diff options
author | Azul <azul@riseup.net> | 2016-03-26 18:42:36 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-05-02 08:31:18 -0300 |
commit | 500fa2db1d593131d7cebd127c941a44bf174223 (patch) | |
tree | bf674b561a98b2c57f16c7ca9602c1b59209f95a /app | |
parent | 7574862cdb8f43e9e4334924dc360f3d20b2c5fd (diff) |
use icon helper from navigation helper
and use content_tag inside the icon helper... html_safe is evil.
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 3 | ||||
-rw-r--r-- | app/helpers/navigation_helper.rb | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 23b2752..920186d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -19,7 +19,8 @@ module ApplicationHelper # http://twitter.github.io/bootstrap/base-css.html#icons # def icon(name, color=nil) - "<span class=\"glyphicon glyphicon-#{name} #{color_class(color)}\"></span> ".html_safe + content_tag :span, '', + class: "glyphicon glyphicon-#{name} #{color_class(color)}" end def big_icon(name, color=nil) diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb index 2639246..1df840c 100644 --- a/app/helpers/navigation_helper.rb +++ b/app/helpers/navigation_helper.rb @@ -66,9 +66,9 @@ module NavigationHelper end def extract_icon!(options) - icon = options.delete(:icon) - if icon.present? - content_tag(:i, '', class: "icon-#{icon}") + name = options.delete(:icon) + if name.present? + icon name else "" end |