title: Jquery FullCalendar- Change event color according to even_type in ruby app
body: <p>I'm using Jquery full calendar from <a href="http://arshaw.com/fullcalendar" rel="nofollow">http://arshaw.com/fullcalendar</a> in my ruby apps. I wanna show different color for 4 different kind of events like (Holidays, School, Work, Fun) which were saved in my events table as type_of_event</p>
  
  <p>Right now I'm fetching events only with start_at and end_at using below code:</p>
  
  <pre><code>scope :before, lambda {|end_time| {:conditions =&gt; ["ends_at &lt; ?", Event.format_date(end_time)] }}
    scope :after, lambda {|start_time| {:conditions =&gt; ["starts_at &gt; ?", Event.format_date(start_time)] }}
  
  
    # need to override the json view to return what full_calendar is expecting.
    # http://arshaw.com/fullcalendar/docs/event_data/Event_Object/
    def as_json(options = {})
      {
        :id =&gt; self.id,
        :title =&gt; self.title,
        :description =&gt; self.description || "",
        :start =&gt; starts_at.rfc822,
        :end =&gt; ends_at.rfc822,
        :allDay =&gt; self.all_day,
        :recurring =&gt; false,
        :url =&gt; Rails.application.routes.url_helpers.event_path(id),
        #:color =&gt; "red"
      }
  
    end
  
    def self.format_date(date_time)
      Time.at(date_time.to_i).to_formatted_s(:db)
    end
  </code></pre>
  
  <p>Is there any specific way to show events color according to their event_type means if event type is school it will show me red color</p>