FullCalendar Rail资产

问题描述:

我正在使用fullcalendar rails gem。我刚刚下载了包含fullcalendar插件的js和css文件的日历zip文件。对于fullcalendar gem上的所有教程,我还没有看到任何人加载zip文件并在其代码中使用这些文件(它们使用CDN链接,但那些文件看起来没有工作),放置这些压缩资源的最佳文件夹在哪里以便我可以在日历上获得所需的结果?FullCalendar Rail资产

如果您使用gem,则不需要下载任何文件。

你必须:

  1. 安装宝石
  2. application.js文件中添加指令//= require fullcalendar

而对于可以使用它。

阅读宝石https://github.com/bokmann/fullcalendar-rails 的README因为你还需要moment.js

不要从zip文件安装。

请按照https://github.com/bokmann/fullcalendar-rails#installation上的说明进行安装;您将可以轻松管理依赖关系。

按规定有步骤如下:

  1. 添加gem 'fullcalendar-rails'到Gemfile中
  2. 添加gem 'momentjs-rails'到Gemfile中,如果你想使用fullcalendar-rails宝石2.1.1.0或更高版本。
  3. 运行bundle install安装宝石。
  4. application.js
  5. 添加//= require fullcalendar(和//= require moment)添加*= require full calendarapplication.css
+0

我最初加入的宝石,但我无法得到的CSS和JS工作,直到我补充一下:添加到我的应用中,并且此CDN中的css和js根本不好 – Zippo9