Given:
<%= f.fields_for :socials do |builder| %>
<%= render :partial => "social_fields", :locals => { :f => builder} %>
<% end %>
how can I get a counter/index inside the _social_fields.html.erb counter (in order to to something on the last item)? social_fields_counter seems to only be generated if you explicitly pass :collection to render, but these are nested objects with accepts_nested_attributes_for :socials in the parent.
Inside _social_fields.html.erb
:
<%= f.options[:child_index] %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With