Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

3 Level nested form bug #276

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

3 Level nested form bug #276

wants to merge 10 commits into from

Commits on Jul 9, 2013

  1. Configuration menu
    Copy the full SHA
    01924f3 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2014

  1. compatible with ruby 1.8

    Ben Zhang committed Jan 7, 2014
    Configuration menu
    Copy the full SHA
    76d1dbe View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2017

  1. rm sym link

    BenZhang committed Feb 7, 2017
    Configuration menu
    Copy the full SHA
    f89f781 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2017

  1. fix bug

    fidel-hsiung committed Oct 31, 2017
    Configuration menu
    Copy the full SHA
    034831b View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from fidel-hsiung/master

    Fix same nested association name bug
    BenZhang authored Oct 31, 2017
    Configuration menu
    Copy the full SHA
    834d43c View commit details
    Browse the repository at this point in the history
  3. rm .rvmrc

    BenZhang committed Oct 31, 2017
    Configuration menu
    Copy the full SHA
    7632c5c View commit details
    Browse the repository at this point in the history
  4. drop support for 3.1

    BenZhang committed Oct 31, 2017
    Configuration menu
    Copy the full SHA
    13e73b6 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2017

  1. Fix bug that regular expression will mismatch unwanted text in blueprint

    When nested form create blueprint according to the nested association,
    the format of name and id is as below:
    
    name="api_endpoint[parameters_attributes][0][children_attributes][0][children_attributes][new_children][required]"
    id="api_endpoint_parameters_attributes_0_children_attributes_0_children_attributes_new_children_required"
    
    In previous code, regexp below will mismatch "[children_attributes][new_children]"
    
    RegExp('(\[' + parentNames[i] + '\])\[.+?\]', 'g')
    	=> /(\[parameters_attributes\])\[.+?\]/g
    	=> /(\[children_attributes\])\[.+?\]/g
    
    In order to filter "new_children", chang the regexp into:
    
    RegExp('(\[' + parentNames[i] + '\])\[[0-9]+?\]', 'g')
    jefferyxhy committed Nov 21, 2017
    Configuration menu
    Copy the full SHA
    2b6ed23 View commit details
    Browse the repository at this point in the history
  2. Change the logic of replacing name and id pattern from parents

    When create nested form, name and id in  created blueprint is in format as below:
    
    id="api_endpoint_parameters_attributes_xxx_children_attributes_xxx_children_attributes_new_children_required"
    
    name="api_endpoint[parameters_attributes][xxx][children_attributes][xxx][children_attributes][new_children][required]"
    
    To correctly create nested form, we use regular expression to match parent pattern in id and name:
    
    =>_parameters_attributes_xxx_children_attributes_xxx
    =>[parameters_attributes][xxx][children_attributes][xxx]
    
    Then replace them with ones we find from closest parent.
    jefferyxhy committed Nov 21, 2017
    Configuration menu
    Copy the full SHA
    dae4a72 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2017

  1. Merge pull request #2 from Jeffery-Xie/master

    Modify the logic of replace name and id pattern from parents
    BenZhang authored Nov 22, 2017
    Configuration menu
    Copy the full SHA
    16ba467 View commit details
    Browse the repository at this point in the history