From 062d4583639cdaee07351adc61a8b480247285d1 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sat, 13 Dec 2014 19:28:46 +0100 Subject: [PATCH] added class option to nav_entry --- app/helpers/application_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5b091b59..e2c93b86 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,7 +3,8 @@ module ApplicationHelper options = { badge: nil, badge_color: nil, - icon: nil + icon: nil, + class: '' }.merge(options) unless options[:icon].nil? @@ -17,7 +18,7 @@ module ApplicationHelper }"))}" end - content_tag(:li, link_to(body.html_safe, path), class: ('active' if current_page? path)) + content_tag(:li, link_to(body.html_safe, path), class: ("#{'active ' if current_page? path}#{options[:class]}")) end ##