From e040a98bf20cb24f71ce0c75e5dbe299efef9517 Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Mon, 26 Oct 2009 16:26:42 +0100 Subject: [PATCH] show title instead of first photo if album has no photos --- app/views/collections/_form.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/collections/_form.html.erb b/app/views/collections/_form.html.erb index 9efc9c2..d236555 100644 --- a/app/views/collections/_form.html.erb +++ b/app/views/collections/_form.html.erb @@ -11,7 +11,11 @@ <% form.fields_for :album_list do |album_fields| %> +<% if album.photos.empty? %> <%= image_tag album.photos.first.path_modified_public('album'), :alt => album.title %> +<% else %> +<%= album.title %> +<% end %> <%= album_fields.hidden_field album.id %> <% end %>