Rails 4, Full Calendar, Display Events Array
<p>Hoping someone can help - I'm trying to display an array of events in my Full Calendar Gem implementation.</p>

<p>In my controller, I have:</p>

<pre><code>@events_array = 
        [
            {
                title: 'event1',
                start: '2016-03-01'
            },
            {
                title: 'event2',
                start: '2016-03-05',
                end: '2016-03-07'
            },
            {
                title: 'event3',
                start: '2016-03-09T12:30:00',
                allDay: false
            }
        ]
</code></pre>

<p>In my view, I have the following script: </p>

<pre><code>&lt;script&gt;
    $(document).ready(function() {
        // page is now ready, initialize the calendar...
        $('#calendar').fullCalendar({
            // put your options and callbacks here
            height: "auto",
            events: "&lt;%= @events_array %&gt;"
        })
    });
&lt;/script&gt;
</code></pre>

<p>The code above doesn't seem to be pulling the events into the calendar. However, when I replace "&lt;%= @events_array %>" with:</p>

<pre><code>[
                {
                    title: 'event1',
                    start: '2016-03-01'
                },
                {
                    title: 'event2',
                    start: '2016-03-05',
                    end: '2016-03-07'
                },
                {
                    title: 'event3',
                    start: '2016-03-09T12:30:00',
                    allDay: false
                }
            ]
</code></pre>

<p>directly in the View script, it works. =/ Any suggestions?? Thanks!</p>

<p>EDIT: The HTML render:</p>

<pre><code>&lt;script&gt;
    $(document).ready(function() {
        // page is now ready, initialize the calendar...
        $('#calendar').fullCalendar({
            // put your options and callbacks here
            height: "auto",
            events: "[{:title=&amp;gt;&amp;quot;event1&amp;quot;, :start=&amp;gt;&amp;quot;2016-03-01&amp;quot;}, {:title=&amp;gt;&amp;quot;event2&amp;quot;, :start=&amp;gt;&amp;quot;2016-03-05&amp;quot;, :end=&amp;gt;&amp;quot;2016-03-07&amp;quot;}, {:title=&amp;gt;&amp;quot;event3&amp;quot;, :start=&amp;gt;&amp;quot;2016-03-09T12:30:00&amp;quot;, :allDay=&amp;gt;false}]"
        })
    });
&lt;/script&gt;
</code></pre>

<p>Is it the extra quotes that is messing it up? How would I get rid of it?</p>