Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6961139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:29:32+00:00 2026-05-27T15:29:32+00:00

Using Enumerable, I am trying to display dates in an organized event calendar by

  • 0

Using Enumerable, I am trying to display dates in an organized event calendar by dates. Not as a standard 7 grid calendar.

Trying to get:

December 1, 2011
Event 1
Event 2
Event 3

December 2, 2011
Event 4
Event 5

December 3, 2011
Event 6

…

Currently Enumerable confuses the hell outta me. Thanks for any guidance–

EDIT Dec.22,2011

Current Data:

Controller string-

@events = Event.where('start >= ?', Date.today).paginate(:per_page => 15, :page => params[:page])

View call-

<% @events.each do |event| %>
  <table stuff here>
<% end %>

Method- Have not specified anything enumerable on method as of now—

My table includes the following fields; :title, :venue, :address (is geocoded), :about (text), :start (datetime function)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:29:33+00:00Added an answer on May 27, 2026 at 3:29 pm

    Update for question update: So you have a bunch of event objects in @events so you could use a group_by:

    @events_by_date = @events.group_by { |e| e.start.to_date }
    

    That would give you a Hash in @events_by_date with dates as the keys and arrays of Event objects as the values.

    Then you’d want an array of arrays of Dates to match your month and drive the table from that array:

    <table>
        <% @month.each do |week| %>
            <tr>
                <% week.each do |day| %>
                    <td>
                        <% if day %>
                            <%= day.day %>
                            <% @events_by_date[day].to_a.each do |e| %>
                                <%= e.about %>
                            <% end %>
                        <% end %>
                    </td>
                <% end %>
            </tr>
        <% end %>
    </table>
    

    There would be some formatting involved of course but the structure would be similar.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a list of assemblies for NHibernate to scan. I'm using
In Ruby, I'm used to using Enumerable#inject for going through a list or other
I was reading an article on MSDN Magazine about using the Enumerable class in
Is it possible to return a single value and an enumerable collection using LINQ
I'm trying to set up a page where I display a list of items
Is there some way of detecting whether an enumerable built using LINQ (to Objects
I'm trying to build a utility method using Linq that will help me with
I'm trying to implement quicksort in a functional style using C# using linq, and
I'm using ASP.Net with MVC 3 and trying to auto generate images. In my
I have a method that performs a simplistic 'grep' across files, using an enumerable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.