14
我看過的苗條的文檔,我仍然無法弄清楚如何做到這一點的纖薄:的form_for方法,使用超薄
<%= form_for([@post, @post.comments.build]) do |f| %>
<div class="field">
<%= f.label :commenter %><br />
<%= f.text_field :commenter %>
</div>
<div class="field">
<%= f.label :body %><br />
<%= f.text_area :body %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
我嘗試這樣
第一線翻譯= form_for([@post, @post.reviews.build]) do |f|
但我得到一個語法錯誤。