numerous.js icon indicating copy to clipboard operation
numerous.js copied to clipboard

Ability to persist through validation errors

Open ngottlieb opened this issue 11 years ago • 0 comments

It's actually a quick fix that doesn't involve any code changes, but figured you might want to add it to the docs. In order to have the new fields persist through a re-rendering of the form (due to validation errors, most likely), you'll want to add another non-numerous fields_for :association.

So,

#tags
  = f.simple_fields_for :tags do |tag_form|
    = tag_form.input :name

is all it takes. I think this is a pretty common use case, so may be worth adding to the Readme / demo docs. Unfortunately the out-of-the-box Numerous.js remove button doesn't work on it, but it's easy enough to roll your own for these fields. I suspect Ajedi32's pull request might solve this, though I haven't looked in much detail.

(sorry about the double post from the other account).

ngottlieb avatar Sep 30 '13 16:09 ngottlieb