Also, each just iterates over the collection and then returns the original collection. You'll want to use map/collect or inject instead.

tag 'kids:kid_sport_list' do |tag|
 kid = tag.locals.kid
 kid.sports.map {|s| s.name.to_s }.join(", ")
end

Sean

Jim Gay wrote:

On Feb 3, 2009, at 11:12 AM, Little Known wrote:

 tag 'kids:kid_sport_list' do |tag|
   kid = tag.locals.kid
   kid.sports.each do |sport|
   %{#{sport.name})
   end
 end

For some reason this outputs a "#" for each sport in kid.sports instead
of the name... Would anyone know why?

looks like you have a ) where you should have a }

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to