This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.autotest | Mon May 19 17:56:46 -0700 2008 | [jherdman] |
| |
MIT-LICENSE | Tue May 27 05:50:00 -0700 2008 | [nakajima] |
| |
README | Tue May 27 05:50:00 -0700 2008 | [nakajima] |
| |
Rakefile | Wed Feb 20 01:06:40 -0800 2008 | [nakajima] |
| |
init.rb | Wed Feb 20 01:06:40 -0800 2008 | [nakajima] |
| |
install.rb | Wed Feb 20 01:06:40 -0800 2008 | [nakajima] |
| |
lib/ | Mon May 26 21:46:24 -0700 2008 | [jherdman] |
| |
spec/ | Thu May 22 21:58:37 -0700 2008 | [jherdman] |
| |
tasks/ | Wed Feb 20 01:06:40 -0800 2008 | [nakajima] |
| |
uninstall.rb | Wed Feb 20 01:06:40 -0800 2008 | [nakajima] |
README
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
Javascript.
Usage
=====
You can create a new calendar object by simply running "Calendar.new" from either
your controller or your view. You can specify the month and year of your calendar
like so:
@calendar = Calendar.new(:month => '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.
Example
=======
In your controller...
class PartyController < ApplicationController
def index
@parties = Party.find(:all)
@calendar = Calendar.new
@calendar.add @parties, :schedule_for => :party_date, :html_class => "party_time"
render :action => :index
end
end
In your view...
<%= @calendar.generate %>
Todo
====
- Clean it up. Big time.
- Finish documentation.
Copyright (c) 2007 Pat Nakajima, James Herdman, released under the MIT license




