nex3/haml — Issue #439: form_for displaying rogue hidden form field
Author: joeegan
Created: 2011-10-10 20:14:35+00:00
State: open

The following haml prepends an escaped hidden field to the first `
` resulting in the following html

= f.fields_for :assets do |asset_fields|
- if asset_fields.object.new_record?
%li.file
= asset_fields.file_field :asset, :label => "Image"

-

<input id="static_assets_attributes_0_id" name="static[assets_attributes][0][id]" type="hidden" value="1" />

The following erb does not do this:

<%= f.fields_for :assets do |asset_fields| %>
<% if asset_fields.object.new_record? %>

<%= asset_fields.file_field :asset, :label => "Image" %>

<% end %>
<% end %>

-