From b7c233271b072ba408bfa9e9e8cc6fde7726c558 Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 8 Oct 2009 22:25:12 +0200 Subject: fixed the helper to merge the html options properly --- app/helpers/link_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index e5fc632..65137ee 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb @@ -18,6 +18,10 @@ module LinkHelper active = (params[:page_path].join("/") == path.sub(/^\//, "")) end + active_class = active ? {:class => 'active'} : {:class => 'inactive'} + + html_options = html_options.merge(active_class) + params[:locale] ||= I18n.locale link_to( @@ -27,7 +31,7 @@ module LinkHelper :locale => params[:locale], :page_path => path.sub(/^\//, "").split("/") }, - active ? {:class => 'active'} : {:class => 'inactive'} + html_options ) end -- cgit v1.3