From: Tom Clegg Date: Mon, 4 Feb 2013 06:57:40 +0000 (-0800) Subject: add some nil checks X-Git-Tag: 1.1.0~3374^2~71 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/bf5415545115b5f5b5d3cbb5b9d4663780de6e64 add some nil checks --- diff --git a/app/views/collections/index.html.erb b/app/views/collections/index.html.erb index cb5db8a9e0..8dc4570ddf 100644 --- a/app/views/collections/index.html.erb +++ b/app/views/collections/index.html.erb @@ -33,13 +33,13 @@ - <% @collections.values.sort_by { |c| c[:created_at] }.reverse.each do |c| %> + <% @collections.values.sort_by { |c| c[:created_at] || Time.now }.reverse.each do |c| %> <%= c[:uuid] %> - <%= distance_of_time_in_words(c[:created_at], Time.now).sub('about ','~').sub(' ',' ') if c[:created_at] %> + <%= raw(distance_of_time_in_words(c[:created_at], Time.now).sub('about ','~').sub(' ',' ')) if c[:created_at] %> <%= ('Y' if c[:wanted_by_me]) or ('y' if c[:wanted]) %>