在日历上初始化应用程序css和javascript标签时,不显示fullcalendar标头工具栏按钮 [英] fullcalendar header toolbar buttons not showing when application css and javascript tags are initialized on rails

查看:40
本文介绍了在日历上初始化应用程序css和javascript标签时,不显示fullcalendar标头工具栏按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的rails项目上运行全日历.我正在按照 https://github.com/bokmann/fullcalendar-rails 中的步骤进行操作,但是我发生错误.

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.

日历仅在此视图中正确显示 http://fullcalendar.io/js/fullcalendar-2.2.6/demos/basic-views.html 当我从application.html.erb页面调用所有内容

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>

但是,每当我尝试使其成为动态Rails方式时,它都无法正常运行.所以在我的application.js文件

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 .

和我的application.css.scss文件

and in my application.css.scss file

 *= require_tree 
 *= require_self

和我的application.html.erb文件

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>

请注意,这里唯一的区别是,我已将所需的css和javascript文件放入我的application.js和application.css文件中,并按照rails的建议在我的application.html.erb文件中添加了javascript nd stylesheets标签.但随后,fullcalendar似乎不接受rails的实现方式.

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.

有什么可以做的吗?

谢谢

推荐答案

尝试删除fullcalendar.print.css ...为我解决了该问题.

Try removing fullcalendar.print.css... it fixed the issue for me.

这篇关于在日历上初始化应用程序css和javascript标签时,不显示fullcalendar标头工具栏按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆