{"action":"created","issue":{"url":"https://api.github.com/repos/ncri/nested_form_fields/issues/52","labels_url":"https://api.github.com/repos/ncri/nested_form_fields/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/ncri/nested_form_fields/issues/52/comments","events_url":"https://api.github.com/repos/ncri/nested_form_fields/issues/52/events","html_url":"https://github.com/ncri/nested_form_fields/issues/52","id":117026213,"number":52,"title":"Cannot access options[:parent_builder].nested_child_index","user":{"login":"jgpignis","id":12504623,"avatar_url":"https://avatars.githubusercontent.com/u/12504623?v=3","gravatar_id":"","url":"https://api.github.com/users/jgpignis","html_url":"https://github.com/jgpignis","followers_url":"https://api.github.com/users/jgpignis/followers","following_url":"https://api.github.com/users/jgpignis/following{/other_user}","gists_url":"https://api.github.com/users/jgpignis/gists{/gist_id}","starred_url":"https://api.github.com/users/jgpignis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgpignis/subscriptions","organizations_url":"https://api.github.com/users/jgpignis/orgs","repos_url":"https://api.github.com/users/jgpignis/repos","events_url":"https://api.github.com/users/jgpignis/events{/privacy}","received_events_url":"https://api.github.com/users/jgpignis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-15T23:19:16Z","updated_at":"2015-11-18T00:50:15Z","closed_at":null,"body":"There is no access to index of nested attributes, because it is a private method."},"comment":{"url":"https://api.github.com/repos/ncri/nested_form_fields/issues/comments/157561074","html_url":"https://github.com/ncri/nested_form_fields/issues/52#issuecomment-157561074","issue_url":"https://api.github.com/repos/ncri/nested_form_fields/issues/52","id":157561074,"user":{"login":"jgpignis","id":12504623,"avatar_url":"https://avatars.githubusercontent.com/u/12504623?v=3","gravatar_id":"","url":"https://api.github.com/users/jgpignis","html_url":"https://github.com/jgpignis","followers_url":"https://api.github.com/users/jgpignis/followers","following_url":"https://api.github.com/users/jgpignis/following{/other_user}","gists_url":"https://api.github.com/users/jgpignis/gists{/gist_id}","starred_url":"https://api.github.com/users/jgpignis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgpignis/subscriptions","organizations_url":"https://api.github.com/users/jgpignis/orgs","repos_url":"https://api.github.com/users/jgpignis/repos","events_url":"https://api.github.com/users/jgpignis/events{/privacy}","received_events_url":"https://api.github.com/users/jgpignis/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T00:50:15Z","updated_at":"2015-11-18T00:50:15Z","body":"Hi,\n\n \n\nMy problem was \n\n1.       I have a nested form which creates a number field entry for a column :qty_received in my netsed model with the accepts_nested_attributes\n\n2.       In the view the name of the number field is model[nested_model][nested_child_index][attribute] (ex. model[model1][0][qty_received])\n\na.       So the hash will be model => { netsed_attributes => { :qty_received => “value sent” } }\n\n3.       The problem was that I needed to add an attribute to each of the same nested attributes (lote)\n\na.       For this the text_field should have the name model[model1][0][lote]\n\nb.      Then the lote attribute will be added to the hash as it belongs to it\n\nc.       So the problem was how to create a text_field_tag with the name of the number field without an attribute in my model?\n\n \n\n= form_for @purchase_order do |f|\n\n                  = f.nested_fields_for :item_list do |ff|\n\n                    %tr\n\n                      %td= ff.object.material\n\n                      %td= ff.object.qty\n\n                      %td= ff.object.qty_received\n\n                      - if ff.object.qty_received != ff.object.qty\n\n                          %td= ff.number_field :qty_received, required: true, min: 0, max: ff.object.qty, value:0, :step => 0.01\n\n                          %td= text_field_tag \"#{ff.test_index(ff.object)}[lote]\"\n\n \n\nTest_index is a method added by me in the gem as follows, which will return the string “model[model1][nested_child_index]” so I can add to the hash whichever attribute I want.\n\n \n\n    def test_index association_name\n\n      \"#{object_name}\"\n\n    end\n\n \n\nJose Victor Garcia\n\nProcess and Operations Director\n\n \n\nhttps://docs.google.com/uc?export=download&id=0B0NZsRPs-VSHbWtQZktPcDFIM1E&revid=0B0NZsRPs-VSHQzNCczBBazZkTTJaUCtUanVYZXkxS1UrQzdRPQ\n\n \n\n  <https://www.facebook.com/IgnisSoftware> https://docs.google.com/uc?export=download&id=0B0NZsRPs-VSHb3hta0k3S012eDg&revid=0B0NZsRPs-VSHbUtFcjZ4REVFVFB0U1M4bkdhajE3V1FTMlA0PQ   <https://twitter.com/IgnisSoftware> https://docs.google.com/uc?export=download&id=0B0NZsRPs-VSHRU1GVDJSZkFQZlU&revid=0B0NZsRPs-VSHSFJMeFpJUDE3YUNMeXdUWFE1VzJmUWM5QW1zPQ  https://docs.google.com/uc?export=download&id=0B0NZsRPs-VSHb0VnOTAxWjFYQm8&revid=0B0NZsRPs-VSHbTVncmRtM1VjSEpjclBGTG91YzZESCtrdWVjPQ  https://docs.google.com/uc?export=download&id=0B0NZsRPs-VSHVWRWbksycHV2TFU&revid=0B0NZsRPs-VSHVVJ0VmMzWmZZY3A2dEpEQWhyakZybHJXbVdVPQ\n\n \n\n  \n\n+52 656 136 0085 |   <mailto:jgp@ignis.software> jgp@ignis.software |  Ciudad Juárez, Chihuahua, México | \n\n \n\nThis e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.\n\n \n\n \n\nFrom: Nico Ritsche [mailto:notifications@github.com] \nSent: Tuesday, November 17, 2015 6:51 AM\nTo: ncri/nested_form_fields\nCc: jgpignis\nSubject: Re: [nested_form_fields] Cannot access options[:parent_builder].nested_child_index (#52)\n\n \n\nGlad you got it working, but patching the gem shouldn't be necessary for something like this.\nIf you can give me an example of your view code I could look into it, i don't quite understand yet what you are doing. \n\n—\nReply to this email directly or view it on GitHub <https://github.com/ncri/nested_form_fields/issues/52#issuecomment-157374824> .  <https://github.com/notifications/beacon/AL7OLyo5bAZYovVZgjcHdC7b2eemGCrlks5pGygqgaJpZM4GipFR.gif> \n\n"}}