I use nested forms and would like to get some kind of “this” in it:
The View looks like this:
<div class="field">
<%= f.label :user_id %><br />
<%= f.number_field :user_id %>
</div>
<% f.fields_for :assignments do |builder| %>
<%= builder.label :count %>
<%= builder.text_field :count %>
<%= @a.fetch(this.id) %>
<% end %>
The @a is an array with the caption of the assignment. So how can I access the current assignment? Or would this code only display a form for one assignment?
Thanks for your help!
Via
#objectapplied to your builder: