From 0d8879354fbd251e4509a0ab5c6b6e47aa3fa47d Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 19 Jul 2009 18:40:07 +0200 Subject: fixed link_for_path issue --- app/helpers/link_helper.rb | 4 +++- app/views/nodes/index.html.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 3be5953..b40aa4b 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb @@ -1,7 +1,9 @@ module LinkHelper def link_to_path title, path, html_options = {} - active = (params[:page_path].join("/") == path.sub(/^\//, "")) + if params[:page_path] + active = (params[:page_path].join("/") == path.sub(/^\//, "")) + end params[:locale] ||= I18n.locale diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index 727cfa1..2f6069f 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb @@ -17,7 +17,7 @@ <%= node.id %>

<%= link_to title_for_node(node), edit_node_path(node) %>

-

<%= link_to_path(node.unique_name, node.unique_path) %>

+

<%= link_to_path(node.unique_name, node.unique_name) %>

<%= link_to 'Preview', node_path(node) %> -- cgit v1.3