Mark Locklear
Mark Locklear

Reputation: 5325

fullcalendar-rails gem in rails 4

I'm trying to get the https://github.com/bokmann/fullcalendar-rails gem to work in rails 4. I have a new rails 4 app and have added the gem and ran bundle. I also created a calendar controller and view with the following...

#app/views/calendar/index.html.erb
<div id='calendar'></div>

#app/assets/stylesheets/application.css
 *= require_self
 *= require fullcalendar
 *= require_tree .
 */

#app/assets/javascripts/application.js
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require fullcalendar
//= require_tree .

When I load the page, I get nothing, and no relevant errors in the firefox error console.

Upvotes: 3

Views: 5190

Answers (3)

user3375663
user3375663

Reputation: 169

Had the same problem as @Carlos with full calender rails gem on version 2.3.1.0 and had to move to 2.0.2.0

Upvotes: 0

I'm leaving this here in case someone else needs it.

I had the same problem and pasting the above code did not help. I finally fixed it changing the gem version from 2.1.1.0 to 2.0.2.0

Upvotes: 0

Dylan Markow
Dylan Markow

Reputation: 124409

You need to actually call the javascript function to set up the calendar; the gem only sets up the JS files in the asset pipeline.

See http://arshaw.com/fullcalendar/docs/usage/ for an example:

$(document).ready(function() {

    // page is now ready, initialize the calendar...

    $('#calendar').fullCalendar({
        // put your options and callbacks here
    })

});

Upvotes: 4

Related Questions