<% files = tab.association_type == :one ? [resource.send(tab.association.name)].compact : resource.send(tab.association.name) %> <% files.each do |file| %> <%= render_component *tab.build("", :image, :file => file, :value => nil) %> <% end %>