title: fullcalendar-rails transfer user id through javascript
body: <p>I have a question I am building a calendar using fullcalendar-rails, and I have a small problem. I am using the eventsources function (url parameter), so the calendar knows where to retrieve the events to display. But my events resources are nested under my users resources. Therefore to access the events i need to follow this route -> 'users/:id/events'. So my question is how do i go about transfering these required parameters to the eventsources :url function ? Also, I just want to mention that i am using json so the calendar maybe able to display the events. Inside my json array I have a url parameter that contains the event's url is there a way for me to transfer that json.url ? </p>
  
  <p>I apologize that I have not displayed any of my codes  yet but I am currently at work now and i do not have access to it. As sooon as get access to a pc ill reedit it and display my code. Its been bugging me for so long so I thought that Id just ask first.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>calendar.js.coffee</strong></p>
  
  <pre><code>$(document).ready -&gt;
    $('#calendar').fullCalendar
     editable: true,
     header:
     left: 'prev,next today',
     center: 'title',
     right: 'month,agendaWeek,agendaDay'
     defaultView: 'month',
     height: 500,
     slotMinutes: 30,
  
  eventSources: url: "/events.json" &lt;----This is the part that where the calendar reads the events from but i need it to be 'users/:id/events.json'
  
  timeFormat: 'H(:mm) ',
  dragOpacity: "0.5",
  
  displayEventEnd: 
      month: true,
      basicWeek: true
  
  eventDrop: (event, dayDelta, minuteDelta, allDay, revertFunc) -&gt;
    updateEvent(event);
  
  eventResize: (event, dayDelta, minuteDelta, revertFunc) -&gt;
    updateEvent(event);
  
  
  updateEvent = (the_event) -&gt;
   $.update "/events/" + the_event.id,
     event:
       title: the_event.title,
       starts_at: "" + the_event.start,
       ends_at: "" + the_event.end,
       description: the_event.description
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>Rails.application.routes.draw do
    get 'staticpages/welcome'
    get 'staticpages/about'
    get 'staticpages/contact'
    get 'calendar/index'
  
    root 'staticpages#welcome'
  
    devise_for :users
  
    resources :users, :only =&gt; [:show] do
      member do
        resources :events, :as =&gt; :user_events
      end
    end
  </code></pre>
  
  <p><strong>index.json.jbuilber</strong></p>
  
  <pre><code>json.array!(@events) do |event|
  json.extract! event, :id, :title, :description
  json.start event.starts_at
  json.end event.ends_at
  json.allday event.all_day
  json.url event_url(event, format: :html)
  end
  </code></pre>