show title instead of first photo if album has no photos
This commit is contained in:
parent
b3be24eca2
commit
e040a98bf2
|
@ -11,7 +11,11 @@
|
||||||
<% form.fields_for :album_list do |album_fields| %>
|
<% form.fields_for :album_list do |album_fields| %>
|
||||||
<span>
|
<span>
|
||||||
<img src="/images/delete-24x24.png" border="" class="delete" />
|
<img src="/images/delete-24x24.png" border="" class="delete" />
|
||||||
|
<% if album.photos.empty? %>
|
||||||
<%= image_tag album.photos.first.path_modified_public('album'), :alt => album.title %>
|
<%= image_tag album.photos.first.path_modified_public('album'), :alt => album.title %>
|
||||||
|
<% else %>
|
||||||
|
<%= album.title %>
|
||||||
|
<% end %>
|
||||||
<%= album_fields.hidden_field album.id %>
|
<%= album_fields.hidden_field album.id %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue