diff options
| -rw-r--r-- | app/helpers/link_helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 | |||
| 18 | active = (params[:page_path].join("/") == path.sub(/^\//, "")) | 18 | active = (params[:page_path].join("/") == path.sub(/^\//, "")) |
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | active_class = active ? {:class => 'active'} : {:class => 'inactive'} | ||
| 22 | |||
| 23 | html_options = html_options.merge(active_class) | ||
| 24 | |||
| 21 | params[:locale] ||= I18n.locale | 25 | params[:locale] ||= I18n.locale |
| 22 | 26 | ||
| 23 | link_to( | 27 | link_to( |
| @@ -27,7 +31,7 @@ module LinkHelper | |||
| 27 | :locale => params[:locale], | 31 | :locale => params[:locale], |
| 28 | :page_path => path.sub(/^\//, "").split("/") | 32 | :page_path => path.sub(/^\//, "").split("/") |
| 29 | }, | 33 | }, |
| 30 | active ? {:class => 'active'} : {:class => 'inactive'} | 34 | html_options |
| 31 | ) | 35 | ) |
| 32 | end | 36 | end |
| 33 | 37 | ||
