summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-02 14:12:23 +0100
committerhukl <contact@smyck.org>2009-03-02 14:12:23 +0100
commitddc961fd81b37b44078fba35f0769b661e1e81ce (patch)
tree99c26aa563605efeed5194171bbfbcedbbcbb4ab
parente453dce6ec96906306967ad124cee79d11cd24fa (diff)
put the rendering of titles in the node overview into the nodes_helper
-rw-r--r--app/helpers/nodes_helper.rb8
-rw-r--r--app/views/nodes/index.html.erb2
2 files changed, 9 insertions, 1 deletions
diff --git a/app/helpers/nodes_helper.rb b/app/helpers/nodes_helper.rb
index 673b561..fc5b0a0 100644
--- a/app/helpers/nodes_helper.rb
+++ b/app/helpers/nodes_helper.rb
@@ -1,2 +1,10 @@
1module NodesHelper 1module NodesHelper
2
3 def title_for_node node
4 if node.head
5 truncate(node.head.title, :length => 50)
6 else
7 truncate(node.draft.title, :length => 50)
8 end
9 end
2end 10end
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb
index 5d59f5d..1429d1a 100644
--- a/app/views/nodes/index.html.erb
+++ b/app/views/nodes/index.html.erb
@@ -16,7 +16,7 @@
16 <tr class="<%= cycle("even", "odd") %>"> 16 <tr class="<%= cycle("even", "odd") %>">
17 <td> 17 <td>
18 <strong> 18 <strong>
19 <%= truncate(node.head.title, :length => 50) if node.head %> 19 <%= title_for_node node %>
20 </strong> 20 </strong>
21 </td> 21 </td>
22 <td><%= node.unique_name %></td> 22 <td><%= node.unique_name %></td>