From 2cded5c6ae21877748199575e2b8525f033a837f Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 18 Feb 2012 21:16:22 +0100 Subject: handle missing node gracefully --- app/views/search/_search_result.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/search') diff --git a/app/views/search/_search_result.html.erb b/app/views/search/_search_result.html.erb index b480f89..a1c0274 100644 --- a/app/views/search/_search_result.html.erb +++ b/app/views/search/_search_result.html.erb @@ -1,4 +1,4 @@
-

<%= link_to node.head.title, content_path(node.unique_path) %>

+

<%= link_to ( node.head ? node.head.title : "No title" ), content_path(node.unique_path) %>

<%= node.head.abstract %>

\ No newline at end of file -- cgit v1.3 From 16ffafb4ebbc7118b50a09205666ffafda05ad6b Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 18 Feb 2012 21:30:49 +0100 Subject: graceful handling of weird search results --- app/views/search/_search_result.html.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/views/search') diff --git a/app/views/search/_search_result.html.erb b/app/views/search/_search_result.html.erb index a1c0274..14898a2 100644 --- a/app/views/search/_search_result.html.erb +++ b/app/views/search/_search_result.html.erb @@ -1,4 +1,6 @@ +<% if node.head %>
-

<%= link_to ( node.head ? node.head.title : "No title" ), content_path(node.unique_path) %>

-

<%= node.head.abstract %>

-
\ No newline at end of file +

<%= link_to node.head.title, content_path(node.unique_path) %>

+

<%= node.head.abstract %>

+ +<% end %> \ No newline at end of file -- cgit v1.3