msayen
msayen

Reputation: 115

How to start with fullcalendar-rails gem in Ruby on Rails app?

I've followed instruction from https://github.com/bokmann/fullcalendar-rails#installation for installation. At the end I've added <div id="calendar"></div> to the view. But nothing happened - view is empty. Any ideas how to start with empty calendar (how to display it) in rails app?

Here are my files: index.html.erb:

    <div class='row'>
  <div class='col-md-12'>
    <p><h4>Hello, <%= current_user.name %></h4></p>
  </div>
</div>

<div id="calendar"></div>

application.js:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap-sprockets
//= require_tree .

//=require moment
//=require fullcalendar


$(document).ready(function() {
    $('#calendar').fullcalendar({
    })
});

and in application.scss I've added only:

*= require fullcalendar

Upvotes: 2

Views: 888

Answers (2)

msayen
msayen

Reputation: 115

And here goes the answer:

$(document).ready(function() {
    $('#calendar').fullCalendar({})
});

fullCalendar, not fullcalendar.

Maybe there was a change in the lib in the meantime.

Upvotes: 1

dkang
dkang

Reputation: 31

Apart from https://stackoverflow.com/a/44021841/1648019, that is correct. If you are using application.scss, you should use @import 'fullcalendar' instead of *= require fullcalendar

Upvotes: 2

Related Questions