Skip to content

naming convention configurable for repeatable fields? #147

Description

@nicolasfranck

Repeatable fields use dots in the name. While this is convenient for compound fields, this becomes a problem for repeatable fields:

e.g.

name.0

The problem here is that the index is included in the name. What if someone added this field, using javascript:

name.0
name.100

This would lead to an array of 101 elements, having 99 elements with value "undef".

or if someone - in a list of 3 items - deletes one field in the middle of a list:

e.g.

name.0
name.1 => this one is deleted, but you'll still get an array with three elements, one being "undef"
name.2

Rails solves this by adding "[]" after the name. That way the server decides the index value, not the client.

Can this be changed, or is it already available somewhere?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions