# Displaying events On calendar Cell , Like Backpack

**URL:** <https://www.ruby-forum.com/t/displaying-events-on-calendar-cell-like-backpack/158539>\
**Category:** Rails\
**Created:** [January 24, 2009, 2:11pm UTC](https://www.ruby-forum.com/t/displaying-events-on-calendar-cell-like-backpack/158539 "2009-01-24T14:11:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@sanjay](https://www.ruby-forum.com/u/sanjay)\
**Post date:** [January 24, 2009, 2:11pm UTC](https://www.ruby-forum.com/t/displaying-events-on-calendar-cell-like-backpack/158539/1 "2009-01-24T14:11:05Z")

</div>

Hi Geeks,

I have been struggling ahrd to show events on a calendar cells.  
I used the calendar\_helper plugin and defined a todo scaffold

The controller is:

def index

```
@todos = current_user.todos

```

@todo\_by\_date=@todos.find\_all\_by\_due(start\_date)

```
  respond_to do |format|
  format.html # index.html.erb
  format.xml { render :xml => @todos }
end

```

end

error faced when the view is

\<%=calendar(:year =\> @year, :month =\> @month ) do |d|  
@todo\_by\_date.body  
end%\>

ERROR =\> undefined method `body’ for #Array:0x61054b8

& when  
\<%=calendar(:year =\> @year, :month =\> @month ) do |d|  
@todos.find\_all\_by\_due(d)  
end%\>

ERROR =\> undefined method `map’ for #Todo:0x6381854

whats the best way to show events on cells ?  
Any help will be highly appreciated.

regards  
Sanjay
