我用gem来安装ckeditor.因此,项目中没有config.js(实际的gem文件夹中有我不想修改).安装确实在config/initializers文件夹中创建了一个ckeditor.js,它似乎是放置工具栏定义的正确位置.但是我试图让它工作的所有内容都会引发各种语法或方法未找到的错误.有人有这个成功吗?如果是这样,一个快速的例子会非常有帮助.
我目前的ckeditor.js是:
# Use this hook to configure ckeditor
if Object.const_defined?("Ckeditor")
Ckeditor.setup do |config|
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default), :mongo_mapper and
# :mongoid (bson_ext recommended) by default. Other ORMs may be
# available as additional gems.
require "ckeditor/orm/active_record"
# Allowed image file types for upload.
# Set to nil or [] (empty array) for all file types
# config.image_file_types = ["jpg", "jpeg", "png", "gif", "tiff"]
# Allowed attachment file types for upload. …Run Code Online (Sandbox Code Playgroud) 我有一个设备,可以将定期(大约每 5 分钟)行插入到状态表中。每行都被视为一个状态事件并带有时间戳。我需要检测 2 个状态事件何时发生间隔超过 10 分钟。
虽然我可以使用循环解决方案,但它看起来不太优雅,我正在寻找另一个答案。数据库中的表可以简化为:
12:01:00,状态,可以
12:06:31,状态,可以
12:12:02,状态,可以
13:15:43,状态,可以
13,20:33,状态,可以
所以我想检测第三个和第四个状态行之间有 1:03:41 的差距。不用说我有很多数据需要处理。