Looking for Enumerable help I think...

Discussion in 'Ruby' started by Robert Malko, Feb 17, 2008.

  1. Robert Malko

    Robert Malko Guest

    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/.
     
    Robert Malko, Feb 17, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    615
  2. Replies:
    1
    Views:
    877
    Jack Klein
    Apr 13, 2005
  3. Daniel Sheppard
    Replies:
    0
    Views:
    109
    Daniel Sheppard
    Sep 16, 2005
  4. Guy
    Replies:
    22
    Views:
    238
    Gunnar Hjalmarsson
    Apr 20, 2009
  5. David Mark
    Replies:
    17
    Views:
    242
    David Mark
    Mar 23, 2010
Loading...

Share This Page