【发布时间】:2011-12-23 08:28:23
【问题描述】:
无法弄清楚为什么我的标签没有显示在新建和编辑视图中使用的表单中。我只能看到 %h2 标签。 after 声明的部分根本不生成。
这就是我所拥有的。我错过了什么? (_form.html.haml)
=form_for @post do |form|
.
.
.
%p
=form.label :content
%br
=form.text_area :content
%h2
Tags
= render :partial => 'tags/form', :locals => {:form => form}
%p
=form.submit
表单位于 app/views/tags _form.html.haml。 这些都没有出现:
= form.fields_for :tags do |tag_form|
.field
= tag_form.label :name, 'Tag:'
= tag_form.text_field :name
- unless tag_form.object.nil? || tag_form.object.new_record?
.field
= tag_form.label :_destroy, 'Remove:'
= tag_form.check_box :_destroy
或者如果它不在这里。我还应该去哪里看?
谢谢!
【问题讨论】:
-
当你说“app/views/tags _form.html.haml”时,你的意思是“app/views/tags/_form.html.haml”对吧?
标签: ruby-on-rails ruby haml render partial