【问题标题】:rails_admin throws undefined method `html_safe' for nil:NilClassrails_admin 为 nil:NilClass 抛出未定义的方法 `html_safe'
【发布时间】:2014-09-30 21:59:32
【问题描述】:

这是我的模型。在其他类似模型上工作没有错误。 甚至不知道如何解决这个问题。任何帮助是极大的赞赏。谢谢

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"

【问题讨论】:

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


【解决方案1】:

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

有些人回复了解决方法,请随意尝试。但是,问题仍然存在,因此 rails_admin 尚未正式修补。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-09
    • 1970-01-01
    • 2011-07-27
    相关资源
    最近更新 更多