Looking for Enumerable help I think...



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 %>
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: Tefillin on Chol Hamoed
    ... Still seems odd to only wrap the head though. ... "wrapping oneself in tzitzit." ...
    (soc.culture.jewish.moderated)
  • How to use Append Queries to add new records
    ... new problem I haven't been able to wrap my head around. ... Perhaps my problem is that I do not understand HOW append queries work. ... The Access help says "Create a ...
    (microsoft.public.access.queries)
  • Re: Views so far on the new who.
    ... >>You just can't wrap your head around the whole 1/3 the age of ... >billion, or humans *ever* developing interstellar travel, or aliens ...
    (rec.arts.drwho)
  • Witch on a Broom doll was Re: big surprise crochet stuff
    ... take one color and wrap it on your other hand on the part after the ... take second wraped ring and slip it under the `head`, ... strongly around the head so that it becomes a broom, ... HIP thread and comes out on the other side over the hip thread... ...
    (rec.crafts.textiles.yarn)