# Looking for Enumerable help I think

**URL:** <https://www.ruby-forum.com/t/looking-for-enumerable-help-i-think/129347>\
**Category:** Ruby\
**Created:** [February 17, 2008, 7:03am UTC](https://www.ruby-forum.com/t/looking-for-enumerable-help-i-think/129347 "2008-02-17T07:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbee-robert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/dbc845/32.png) [@newbee-robert](https://www.ruby-forum.com/u/newbee-robert)\
**Post date:** [February 17, 2008, 7:03am UTC](https://www.ruby-forum.com/t/looking-for-enumerable-help-i-think/129347/1 "2008-02-17T07:03:04Z")

</div>

I have a piece of code below. I have activities hooked up to a Calendar  
but I’m running into a problem I can’t wrap my head around. What I’m  
trying to achieve is the output: { period: ‘\<%= February 17, 2008 %\>’,  
teaser: [‘Activity 1’, ‘Activity 2’], label: [’’]}, if there is more  
than on activity for a given day.

I was thinking that I would have to dump the information into an array  
and iterator within the teaser: line, but I can’t quite figure it.

Any help would be appreciated.

Thanks!

\<% @projects.each do |a| %\>  
\<% a.activities.each do |b| %\>  
{ period: ‘\<%= b.win\_at.strftime("%B, %d, %Y") %\>’, teaser: [’\<%=  
b.name %\>’], label: [’’]},  
\<% end %\>  
\<% end %\>
