ohne testen aus dem Gedächtnis heraus:

Client
  has_one :key_photo, :class_name => 'Photo', :order => 'id ASC'

und dann
  <%= image_tage client.key_photo...

ODER:


Client
  has_many :photos, :order => 'id ASC'

  <%= image_tag client.photos.first.premium.url(:medium) %>


ciao, tom


Am 13.04.2010 um 21:55 schrieb Werner Laude:

> Hallo .. brauche einen Tipp.
> 
> <% for photo in client.photos %>
>        <%= image_tag photo.premium.url(:medium) %>
> <% end %>
> 
> Da sind 1-2 Bilder drin
> Will aber nur das erste(nach id) anzeigen lassen
> 
> Hoffe ich habe mich verständlich ausgedrückt..
> 

--
Thomas R. "TomK32" Koll
just a geek trying to change the world
http://ananasblau.com || http://photostre.am || http://photolog.at

_______________________________________________
rubyonrails-ug mailing list
rubyonrails-ug@headflash.com
http://mailman.headflash.com/listinfo/rubyonrails-ug

Antwort per Email an