我按照步骤让rails_id在rails引擎中工作 – 发布了
here on github,似乎当我执行以下操作时:
s.add_dependency 'friendly_id','~> 5.0.0'
bundle install #=> works rails g friendly_id #=> works rake db:migrate
我明白了:
rake aborted! uninitialized constant FriendlyId
嗯什么?
更新 – 使用FriendlyId的模态
module Xaaron class Role < ActiveRecord::Base extend FriendlyId friendly_id :role,use: :slugged validates :role,presence: true validates_uniqueness_of :role end end
解决方法
您可能需要从引擎中明确要求FriendlyId(
docs):
require 'friendly_id'