diff options
| author | hukl <contact@smyck.org> | 2009-07-19 18:40:07 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-07-19 18:40:07 +0200 |
| commit | 0d8879354fbd251e4509a0ab5c6b6e47aa3fa47d (patch) | |
| tree | 0009e7a848b47a856527d70701105523d72e6787 /app | |
| parent | 00362bb4817ecc82856e9a9ae5fb6821b3182c6f (diff) | |
fixed link_for_path issue
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/link_helper.rb | 4 | ||||
| -rw-r--r-- | app/views/nodes/index.html.erb | 2 |
2 files changed, 4 insertions, 2 deletions
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 @@ | |||
| 1 | module LinkHelper | 1 | module LinkHelper |
| 2 | 2 | ||
| 3 | def link_to_path title, path, html_options = {} | 3 | def link_to_path title, path, html_options = {} |
| 4 | active = (params[:page_path].join("/") == path.sub(/^\//, "")) | 4 | if params[:page_path] |
| 5 | active = (params[:page_path].join("/") == path.sub(/^\//, "")) | ||
| 6 | end | ||
| 5 | 7 | ||
| 6 | params[:locale] ||= I18n.locale | 8 | params[:locale] ||= I18n.locale |
| 7 | 9 | ||
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 @@ | |||
| 17 | <td class="node_id"><%= node.id %></td> | 17 | <td class="node_id"><%= node.id %></td> |
| 18 | <td class="title"> | 18 | <td class="title"> |
| 19 | <h4><%= link_to title_for_node(node), edit_node_path(node) %></h4> | 19 | <h4><%= link_to title_for_node(node), edit_node_path(node) %></h4> |
| 20 | <p><%= link_to_path(node.unique_name, node.unique_path) %></p> | 20 | <p><%= link_to_path(node.unique_name, node.unique_name) %></p> |
| 21 | </td> | 21 | </td> |
| 22 | <td class="actions"> | 22 | <td class="actions"> |
| 23 | <%= link_to 'Preview', node_path(node) %> | 23 | <%= link_to 'Preview', node_path(node) %> |
