Ich hab auch noch einen:

@seminar.therapists.map(&:name).to_sentence

Ergibt in etwa so etwas: "A, B, and C"


Am 09.12.2010 um 13:07 schrieb rubyonrails...@galt.de:

> @seminar.therapists.map(&:name).join(',')
> 
> Ist es das, was Du meintest?
> 
> Am 09.12.2010 um 13:01 schrieb Werner Laude:
> 
>> Hallo - wieder mal ein Frage von mir.. ;-)
>> 
>> <% @seminar.therapists.each do |therapist| %>
>> 
>> <%=therapist.name %>
>> 
>> <% end %>
>> 
>> Möchte  zwischen den Namen ein 'und' oder Komma/Strich, aber eben nicht nach 
>> dem letzten Eintrag.
>> 
>> Hat da jemand etwas Code oder einen link?
>> 
>> 
>> 
>> Werner Laude
>> http://www.webagentur-laude.de
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> rubyonrails-ug mailing list
>> rubyonrails-ug@headflash.com
>> http://mailman.headflash.com/listinfo/rubyonrails-ug
> 
> _______________________________________________
> rubyonrails-ug mailing list
> rubyonrails-ug@headflash.com
> http://mailman.headflash.com/listinfo/rubyonrails-ug

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

Antwort per Email an