ruby on rails - Getting correct index in nested form's fields_for -


i using ryan bates' nested form in rails 3.2.13 , having issue getting correct indexes when trying embed javascript.

i able index dynamically generated content using:

=f.fields_for :entity, :wrapper => false |e|   =e.input :name   %div{ :id => "entity_#{e.options[:child_index]}" }   :javascript     $("entity_#{e.options[:child_index]}").foo() 

however, when editting same form existing data index blank rows have data.

it looks e.options[:nested_child_index] should contain correct value private variable exception when attempting access it.

how should correct index can pass along?


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -