新手问题 mongo mapper 嵌套的文档如何写 form_for

itsvoid · 2012年09月06日 · 2590 次阅读

有一个 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

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号