Skip to content
Rails plugin to build a simple calendar scaffold, with events signified by class names added to the day.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
spec Removed dependency on facets gem.
tasks initial commit, added files
.autotest Convert to RSpec
README added proper names to README and Licenes
Rakefile initial commit, added files
init.rb Removed dependency on facets gem.
uninstall.rb initial commit, added files


Calendar Maker

Putting a calendar on a web page is easy now. Also, you can add events to a 
calendar, which are denoted by adding a custom class name to that day, allowing
you to style it differently, or even define behavior for that day via unobtrusive


You can create a new calendar object by simply running "" from either
your controller or your view. You can specify the month and year of your calendar
like so:

  @calendar = => 'oct', :year => 2001)
If you'd like to add events to the calendar object, you can simply pass it an
array of objects via its #add method, then designating an attribute to signify the
event date using the :schedule_for option. This option is not optional. If you don't
include it, an ArgumentError exception will be raised.

You can also specify which class should be added to days that have certain events
by using the :html_class option. If you don't provide one, then the plugin will just
add the :schedule_for value as a class name.

Finally, use the #generate method to actually render the HTML code for your calendar.


In your controller...

  class PartyController < ApplicationController
    def index
      @parties  = Party.find(:all)
      @calendar =
      @calendar.add @parties, :schedule_for => :party_date, :html_class => "party_time"
      render :action => :index

In your view...

  <%= @calendar.generate %>


- Clean it up. Big time.
- Finish documentation.

Copyright (c) 2007 Pat Nakajima, James Herdman, released under the MIT license
Something went wrong with that request. Please try again.