有一个 model,outer,其有嵌套文档 specification,annotations,comments,我现在想用 form_for @outer,传统数据库,可以用 symbol,这样写:
<%= f.label :name, "名称", class: 'control-label' %>
嵌套的该怎么写呢?
<%= f.label @outer.specification.title.to_sym, "名称", class: 'control-label' %>
class Outer include MongoMapper::EmbeddedDocument key :author_uid, ObjectId, required: true key :name, String one :specification
many :annotations
many :comments timestamps!
end