最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - fullcalendar-rails gem in rails 4 - Stack Overflow

programmeradmin1浏览0评论

I'm trying to get the 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.

I'm trying to get the https://github./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.

Share Improve this question asked Oct 1, 2013 at 16:31 Mark LocklearMark Locklear 5,3751 gold badge57 silver badges89 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

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./fullcalendar/docs/usage/ for an example:

$(document).ready(function() {

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

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

});

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

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

发布评论

评论列表(0)

  1. 暂无评论