diff options
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/link_helper.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 1b20e6d..29c58f0 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb | |||
| @@ -15,7 +15,8 @@ module LinkHelper | |||
| 15 | 15 | ||
| 16 | def link_to_path title, path, html_options = {} | 16 | def link_to_path title, path, html_options = {} |
| 17 | if params[:page_path] | 17 | if params[:page_path] |
| 18 | active = (params[:page_path].join("/") == path.sub(/^\//, "")) | 18 | page_path = params[:page_path].is_a?(Array) ? params[:page_path].join("/") : params[:page_path] |
| 19 | active = (page_path == path.sub(/^\//, "")) | ||
| 19 | end | 20 | end |
| 20 | 21 | ||
| 21 | active_class = active ? {:class => 'active'} : {:class => 'inactive'} | 22 | active_class = active ? {:class => 'active'} : {:class => 'inactive'} |
| @@ -29,7 +30,7 @@ module LinkHelper | |||
| 29 | :controller => :content, | 30 | :controller => :content, |
| 30 | :action => :render_page, | 31 | :action => :render_page, |
| 31 | :locale => params[:locale], | 32 | :locale => params[:locale], |
| 32 | :page_path => (path.sub(/^\//, "").split("/") rescue "") | 33 | :page_path => (path.sub(/^\//, "") rescue "") |
| 33 | }, | 34 | }, |
| 34 | html_options | 35 | html_options |
| 35 | ) | 36 | ) |
| @@ -51,4 +52,4 @@ module LinkHelper | |||
| 51 | ) | 52 | ) |
| 52 | end | 53 | end |
| 53 | 54 | ||
| 54 | end \ No newline at end of file | 55 | end |
