I want to run the fullcalendar on my rails project. I am following the steps in https://github.com/bokmann/fullcalendar-rails but I am having an error.
the calendar only shows properly as in this view http://fullcalendar.io/js/fullcalendar-2.2.6/demos/basic-views.html when I call everything from my application.html.erb page like this
<!DOCTYPE html>
<html>
<head>
<title>LetsScheduleComMy</title>
<%= csrf_meta_tags %>
<meta charset='utf-8' />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta content="05DB4EB1125C9BB77659AD0ADC8E0BAC" name="msvalidate.01">
<link href='/assets/fullcalendar.css' rel='stylesheet' />
<link href='/assets/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='/assets/moment.min.js'></script>
<script src='/assets/jquery.min.js'></script>
<script src='/assets/fullcalendar.min.js'></script>
<script>
$(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
}
});
});
</script>
</head>
<body>
<%= yield %>
</body>
</html>
But whenever i try to make it dynamic rails way, it doesnt run properly. So in my application.js file
//= require jquery
//= require moment.min
//= require jquery.min
//= require fullcalendar.min
//= require_tree .
and in my application.css.scss file
*= require_tree
*= require_self
and in my application.html.erb file
<!DOCTYPE html>
<html>
<head>
<title>LetsScheduleComMy</title>
<%= stylesheet_link_tag 'application', media: 'all'%>
<%= javascript_include_tag 'application'%>
<%= csrf_meta_tags %>
<meta charset='utf-8' />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta content="05DB4EB1125C9BB77659AD0ADC8E0BAC" name="msvalidate.01">
<script>
$(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
}
});
});
</script>
</head>
<body>
<%= yield %>
</body>
</html>
Kindly note that the only difference here is i have put the required css and javascript files in my application.js and application.css files and added the javascript nd stylesheets tags in my application.html.erb file as recommended by rails. But then it seems fullcalendar doesnt accept rails way of implementation.
Is there anything that can be done?
Thanks