diff options
| author | hukl <contact@smyck.org> | 2009-03-02 14:12:23 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-02 14:12:23 +0100 |
| commit | ddc961fd81b37b44078fba35f0769b661e1e81ce (patch) | |
| tree | 99c26aa563605efeed5194171bbfbcedbbcbb4ab /app/helpers | |
| parent | e453dce6ec96906306967ad124cee79d11cd24fa (diff) | |
put the rendering of titles in the node overview into the nodes_helper
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/nodes_helper.rb | 8 |
1 files changed, 8 insertions, 0 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 @@ | |||
| 1 | module NodesHelper | 1 | module 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 | ||
| 2 | end | 10 | end |
