admin管理员组文章数量:1426072
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 badges3 Answers
Reset to default 4You 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
本文标签: javascriptfullcalendarrails gem in rails 4Stack Overflow
版权声明:本文标题:javascript - fullcalendar-rails gem in rails 4 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745425471a2658090.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论