FullCalendar Rail资产
问题描述:
我正在使用fullcalendar rails gem。我刚刚下载了包含fullcalendar插件的js和css文件的日历zip文件。对于fullcalendar gem上的所有教程,我还没有看到任何人加载zip文件并在其代码中使用这些文件(它们使用CDN链接,但那些文件看起来没有工作),放置这些压缩资源的最佳文件夹在哪里以便我可以在日历上获得所需的结果?FullCalendar Rail资产
答
如果您使用gem,则不需要下载任何文件。
你必须:
- 安装宝石
- 在
application.js
文件中添加指令//= require fullcalendar
而对于可以使用它。
阅读宝石https://github.com/bokmann/fullcalendar-rails 的README因为你还需要moment.js
答
不要从zip文件安装。
请按照https://github.com/bokmann/fullcalendar-rails#installation上的说明进行安装;您将可以轻松管理依赖关系。
按规定有步骤如下:
- 添加
gem 'fullcalendar-rails'
到Gemfile中 - 添加
gem 'momentjs-rails'
到Gemfile中,如果你想使用fullcalendar-rails
宝石2.1.1.0
或更高版本。 - 运行
bundle install
安装宝石。 - 在
application.js
- 添加
//= require fullcalendar
(和//= require moment
)添加*= require full calendar
在application.css
我最初加入的宝石,但我无法得到的CSS和JS工作,直到我补充一下:添加到我的应用中,并且此CDN中的css和js根本不好 – Zippo9