`f.inputs` only generates a legend for the first fieldset. #480

Closed
pivotal-casebook opened this Issue Jan 5, 2011 · 8 comments

Projects

None yet

3 participants

@pivotal-casebook

Given a @post with two comments, when we do the following:

= semantic_form_for @post do |f|
  = f.inputs :content, :name => '%i', :for => :comments

we see a fieldset for each comment, but only the first fieldset has a legend. We expected each fieldset to have a legend.

Demo app with failing test case: https://github.com/pivotal-casebook/formtastic-legend-testcase

@justinfrench
Owner

Having trouble setting up the right spec for this. I can't get it to render more than one nested object (eg comment) in my specs. Can you confirm that your test case actually renders all comments (but only one with a legend)?

@pivotal-casebook

I'm not sure what you mean. Running rake should yield a failing spec.

@pivotal-casebook

I hit the "Comment and Close" button by accident instead of "Comment". Would you reopen this for me? Thanks.

@justinfrench
Owner

I'm trying to set-up a failing spec in Formtastic, not your code base.

@Peeja
Peeja commented Jan 11, 2011

(Replying from my own account:)

Ah, got it. Yes, it's rendering multiple comments. Is your spec missing accepts_nested_attributes, maybe?

@justinfrench
Owner

Ok, am able to reproduce a failing spec, not sure WTF I was doing before. Thanks, looking into it now.

@justinfrench
Owner

Wow, that was a hard one to track down. The :name option was being deleted in the first iteration over the collection, easily fixed with a .dup in 44a9cc3. Will push a beta gem soon, bundle from that specific hash with the :git and :ref options if you're in a hurry.

Closing.

@Peeja
Peeja commented Jan 13, 2011

Awesome! Thanks.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment