I have nested attributes in my show.erb and I create a blank nested attribute and show a grid of items with the blank at the bottom like so.
<%= form_for
The variable you're using l
isn't correct. When you yield from a fields_for
block the block object is an instance of FormBuilder
not an instance of the object itself. What url do you want the link to point to? Is it Answers#destroy
? What id do you want to send to this action for it to identify what to destroy? A link_to
isn't a form element. It's just a helper for an anchor tag. You need a url, not a form builder to build that link.
Is this going to be a list of answer forms? One for each answer? If so, you might want to loop through them instead of just using fields_for
.
Hopefully this helps you get on the right track.