# Event Calendar in Rails

**URL:** <https://www.ruby-forum.com/t/event-calendar-in-rails/169205>\
**Category:** Rails\
**Created:** [May 31, 2009, 8:15pm UTC](https://www.ruby-forum.com/t/event-calendar-in-rails/169205 "2009-05-31T20:15:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyntaff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/87869e/32.png) [@lyntaff](https://www.ruby-forum.com/u/lyntaff)\
**Post date:** [May 31, 2009, 8:15pm UTC](https://www.ruby-forum.com/t/event-calendar-in-rails/169205/1 "2009-05-31T20:15:31Z")

</div>

Hi,

I’m looking to develop a dynamic event calendar for a rails  
application. I found some nifty little embeddable calendars in jQuery  
and Moo Tools that use Json feeds but they seem to conflict with some  
features that I have already developed using prototype.

Is there a rails plugin that I can work with or an embeddable  
prototype solution that I can feed with xml or json?

If anybody has any advice or tips please let me know.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![lyntaff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/87869e/32.png) [@lyntaff](https://www.ruby-forum.com/u/lyntaff)\
**Post date:** [June 1, 2009, 9:15am UTC](https://www.ruby-forum.com/t/event-calendar-in-rails/169205/2 "2009-06-01T09:15:28Z")

</div>

Try calendar\_helper Rails plugin. I’m using this in my events-based  
app right now and love it! It adds appropriate classes to your table  
cells and allows you to add your own classes as well, if you’d rather.  
Plus: No javascript necessary. 🙂

[http://agilewebdevelopment.com/plugins/calendar\_helper](http://agilewebdevelopment.com/plugins/calendar_helper)

In my app, I display the event type, the comedian name with a link to  
edit, ticket price and showtime:

controller:

@year = params[:year].blank? ? Date.today.year : params[:year].to\_i  
@month = params[:month].blank? ? Date.today.month : params  
[:month].to\_i  
@events = Event.all

view:

\<%= calendar({:year =\> @year, :month =\> @month}) do |d|  
cell\_text = “#{d.mday}  
”  
cell\_attrs = {:class =\> ‘day’}  
@events.each do |e|  
if e.showtime.mday == d.mday  
cell\_text \<\< link\_to ( e.comedian.full\_name, :action =\> ‘edit’,  
:id  
=\> e ) \<\< “  
”  
cell\_text \<\< e.event\_type \<\< “  
”  
cell\_text \<\< e.ticket\_price \<\< “  
”  
cell\_text \<\< e.showtime \<\< “  
”  
cell\_attrs[:class] = ‘event\_date’  
end  
end  
[cell\_text, cell\_attrs]  
end  
%\>

---

<div class="post-metadata">

**Author:** ![lyntaff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/87869e/32.png) [@lyntaff](https://www.ruby-forum.com/u/lyntaff)\
**Post date:** [June 1, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/event-calendar-in-rails/169205/3 "2009-06-01T16:46:18Z")

</div>

Thanks so much.

This is the perfect solution.

On Jun 1, 5:47 am, nodoubtarockstar [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![lyntaff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/87869e/32.png) [@lyntaff](https://www.ruby-forum.com/u/lyntaff)\
**Post date:** [June 1, 2009, 7:08pm UTC](https://www.ruby-forum.com/t/event-calendar-in-rails/169205/4 "2009-06-01T19:08:16Z")

</div>

On Mon, Jun 1, 2009 at 10:45 AM, lyntaff [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks so much.
> 
> This is the perfect solution.

Note that the latest version of this is on github

> **[GitHub - topfunky/calendar\_helper: Calendar-generating plugin for Ruby](https://github.com/topfunky/calendar_helper/tree/master)**
>
> master

–  
Rick DeNatale

Blog: [http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)  
Twitter: [http://twitter.com/RickDeNatale](http://twitter.com/RickDeNatale)  
WWR: [http://www.workingwithrails.com/person/9021-rick-denatale](http://www.workingwithrails.com/person/9021-rick-denatale)  
LinkedIn: [http://www.linkedin.com/in/rickdenatale](http://www.linkedin.com/in/rickdenatale)
