【发布时间】:2011-12-31 13:41:24
【问题描述】:
Rails 3 由于某种原因无法渲染 cmets 表单,表单为:
<% form_for ([@post.eng_post, @post.eng_post.eng_comments.build]) do |f| %>
但是
<%= debug @post.eng_post.eng_comments.build %>
给予
--- !ruby/object:EngComment
attributes:
id: !!null
eng_post_id: 97
full_name: !!null
website: !!null
email: !!null
comment: !!null
created_at: !!null
updated_at: !!null
模型的结构如下:
Posts (have one)-> EngPost (has many)-> EngComments
(更详细的模型在这里Rails 3, comments in a nested form, wrong routes?)
谢谢
【问题讨论】:
标签: ruby-on-rails forms comments nested rendering