From e112f8d1939948040ef91404fff384b09a6f928e Mon Sep 17 00:00:00 2001 From: Amanda Nicholas Date: Wed, 9 Jun 2010 15:17:44 +1200 Subject: [PATCH] Simplified logic --- app/views/admin/blogs/index.html.erb | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/app/views/admin/blogs/index.html.erb b/app/views/admin/blogs/index.html.erb index 89cda69..ca624cc 100644 --- a/app/views/admin/blogs/index.html.erb +++ b/app/views/admin/blogs/index.html.erb @@ -7,21 +7,19 @@ <% else %>

Sorry, no results found.

<% end %> + <% elsif @grouped_blogs.any? %> + <% @grouped_blogs.each do |date, posts| %> +

<%= date.strftime("%A, #{date.day} %B %Y") %>

+ + <% end %> <% else %> - <% if @grouped_blogs.any? %> - <% @grouped_blogs.each do |date, posts| %> -

<%= date.strftime("%A, #{date.day} %B %Y") %>

- - <% end %> - <% else %> -

- - There are no posts yet. - Click "Create New Post" to add your first post to your blog. - -

- <% end %> +

+ + There are no posts yet. + Click "Create New Post" to add your first post to your blog. + +

<% end %>