rails_admin抛出未定义的方法`html_safe'为零:NilClass

时间:2014-09-30 21:59:32

标签: ruby-on-rails mongoid rails-admin

这是我的模特。在其他类似模型上正常工作。 甚至不确定如何解决这个问题。任何帮助是极大的赞赏。感谢

class OrderProduct
include Mongoid::Document
include Mongoid::Token

validates :quantity, :numericality => { :greater_than => 0 }

before_save :pre_save
after_save :post_save

token :field_name => :code, :pattern => "%C3%d7%C2"

field :quantity, type: Integer, :default => 1
field :notes, type: String
field :fit_satisfactory, type: Boolean, :default => true, overwrite: true
field :alteration_cost, type: Float, default: 0.0
field :fit_status_saved, type: Date, default: nil
field :initials, type: String
field :last_product_type_order, type: String, default: nil
auto_increment :sequence, :seed => 10000

belongs_to :order_product_status

belongs_to :product, autosave: true
belongs_to :order
belongs_to :product_fit
has_many :product_fit_entry_values, autosave: true

embeds_many :customizations, class_name: "OrderProductCustomization"

1 个答案:

答案 0 :(得分:0)

看起来其他人遇到了同样的问题并将其发布在rails_admin github页面上:

有些人回复了周围的工作,随意尝试这些。但是,问题仍然存在,因此rails_admin尚未正式修补。