Skip to content

Commit

Permalink
Fixed bug with displaying thumbnails in _documents.html.erb
Browse files Browse the repository at this point in the history
  • Loading branch information
janv committed Dec 2, 2009
1 parent 9307a9e commit 4c3cba8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/vrame/categories/_documents.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<% documents.each do |document| %>

<% image = nil %>
<% %w(image bild photo foto).each do |field_name| %>
<% %w(image bild photo foto thumbnail).each do |field_name| %>
<% next unless document.meta.schema.has_field?(field_name) %>
<% field = document.meta.send(field_name) %>
<% if field.file.file? %>
<% field = document.meta[field_name] %>
<% if field.is_a?(Asset) && field.file.file? && File.exist?(field.file.path) %>
<% image = image_tag(field.file.url(:vrame_backend), :alt => '') %>
<% break %>
<% end %>
Expand Down

0 comments on commit 4c3cba8

Please sign in to comment.