尝试加载视图时接收未初始化的常量 Mongoid::Slug。
陷入困境的模型是:
class Course
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Slug
field :title, type: String
slug :title
validates :title, presence: true, uniqueness: true
end
Gemfile 正在拉入 mongoid 和 mongoid-slug,如下所示:
gem 'mongoid', github: 'mongoid/mongoid', branch: 'master'
gem 'mongoid_search', '0.3.2'
gem 'mongoid-slug', github: 'digitalplaywright/mongoid-slug'
gem list 将每个安装的版本显示为:
mongoid (4.0.0)
mongoid-slug (4.0.0)
mongoid-tree (2.0.0)
mongoid_search (0.3.2)
关于这里发生的事情有什么建议吗?