http://pastie.org/4562818

# haml template
%label= "New Images"
.column
  = f.fields_for :product_images do |a_form|
    - if a_form.object.new_record?
      %p= a_form.file_field :image

# html output
<label>New Images</label>
<div class='column'>
&lt;input id=&quot;product_product_images_attributes_0_id&quot; 
name=&quot;product[product_images_attributes][0][id]&quot; 
type=&quot;hidden&quot; value=&quot;13&quot; /&gt;</div>

:product_images has only one element in it and it is NOT new, so really nothing 
should be "printed", never mind an encoded representation of a hidden input 
field.

I have a similar construct below this for the reverse logic and it does not 
suffer from this problem.

I ended up converting this template to erb but still curious what I am doing 
wrong. 

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/haml/-/FQKN5gsVWeQJ.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to