I created a form with nested attribute using cocoon gem. When link_to_add_association was clicked, it will append the label and text_field. However, I would want the label name to be dynamic in the sense that the label name for every label will be different. For instance, I would like to have 'A:' as label name for first label, 'B:' for the second label, and so on and so forth. Is it possible to achieve this?
/_mcq.html.erb
<%= f.fields_for :mcq_options do |option| %>
<%= render 'question_paper_generations/mcq_option_fields', f: option %>
<% end %>
<div><%= link_to_add_association 'Add Option', f, :mcq_options %></div>
/_mcq_options_fields.html.erb
<%= f.label :option %>
<%= f.text_field :option, class: 'form-control' %>