title: Displaying an array of events in full calendar
body: <p>I am trying to integrate the arshaw's jQuery fullcalendar into my rails application. When I click on the calendar tab it should display the calendar with the list of tasks in the database on the corresponding date. </p>
  
  <p>In calendar controller</p>
  
  <pre><code>    def index
  
      @task=Task.find_all_by_pm_id(params[:u])
        @task.each do |t|
          @task_name=t.task_name
          @end_date=t.due_date
        end
      end
  
  In the Calenders/index.html.erb
  
      &lt;script&gt;
       $(document).ready(function() {
          var date = new Date();
          var d = &lt;%=@end_date.day%&gt;;
          var m = &lt;%=@end_date.month%&gt;-1;
          var y = &lt;%=@end_date.year%&gt;;
          var calendar = $('#calender').fullCalendar({
              header: {
                  left: 'prev,next today',
                  center: 'title',
                  right: 'month,agendaWeek,agendaDay'
              },
              selectable: true,
              selectHelper: true,
              events: [
                  {
                      title: '&lt;%=@task_name%&gt;',
                      start: new Date(y, m, d)
                  },
  
              ],
              editable: true
  
          });
  
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Now it is displaying only the last task name. I need to display all the task name on particular dates.  Any inputs on this will be appreciated. Please help</p>