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

JavaScript bug when the parent of a deeply nested attribute is not in a "many" relationship. #26

Open
pirelenito opened this issue Apr 5, 2011 · 10 comments
Labels

Comments

@pirelenito
Copy link
Contributor

The fix proposed in #19 is not complete:

Actually there is still a bug regarding this scenario:

In a Root embeds_one Child embeds_many DeepChild, the name of a deeply nested field would be:

root[child_attributes][deep_child_attributes][0][attribute]

The javascript code responsible to fill the blueprint's parent's ids is broken, since it is always expecting an index after an /[a-z]+attributes/g ex:

root[child_attributes][0][deep_child_attributes][0][attribute]

@ryanb
Copy link
Owner

ryanb commented Apr 5, 2011

Thanks for reporting this. I'll mark this to be fixed in the code.

eljuanchosf added a commit that referenced this issue Apr 19, 2011
@ryanb
Copy link
Owner

ryanb commented Apr 23, 2011

I pulled in the change from @eljuanchosf which should fix this problem. Let me know if it doesn't and I'll re-open.

@ryanb ryanb closed this as completed Apr 23, 2011
@garrettlancaster
Copy link

This problem is still happening for me

@lest
Copy link
Collaborator

lest commented Nov 20, 2012

@garrettlancaster Could you please push a test application reproducing your issue?

@garrettlancaster
Copy link

Sure thing, here is the link: https://github.com/garrettlancaster/nested_form_failing. Let me know if you need anything else.

@garrettlancaster
Copy link

Oh, and make sure to add at least two gifts. It works if you only add one.

Overview of the contrived example:
Person belongs_to Birthday
Birthday has_many Gifts

@lest
Copy link
Collaborator

lest commented Nov 21, 2012

@garrettlancaster Thanks! I'll take a look.

@gedean
Copy link

gedean commented Nov 26, 2012

It happens to me too.

@lest lest reopened this Dec 2, 2012
@garrettlancaster
Copy link

any progress on this?

@eljuanchosf
Copy link
Contributor

Es cierto, debería, pero por algún motivo no sucede lo que debería
suceder.

Habría que identificar en donde se produce el cambio.

  • Tiraste un rake routes para ver si esta la ruta :locale/students/:id?
  • En los logs de la app, recibís un request de es/students/20 ?

Abrazo!

On Sat 23 Apr 2011 02:06:28 PM ART, ryanb wrote:

I pulled in the change from @eljuanchosf which should fix this problem. Let me know if it doesn't and I'll re-open.

Mis mejores deseos,
Best wishes,
Meilleurs vœux,

Juan Pablo

http://www.jpgenovese.com

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants