nested_form_fields
nested_form_fields copied to clipboard
No render new object form in each new/edit view
Hi!
I'm trying to no render new object form in each new/edit view, just shows up by clicking in 'Add another item'. How I could do that? Is there any configuration to do that? Here's my code: `
.row
.col-md-12
= ff.nested_fields_for :questions do |fa|
.container-question-blocks-surveys
.remove-link= fa.remove_nested_fields_link "Remove option"
.md-form.select-form.question_type
.....
= fa.nested_fields_for :question_options do |option|
= option.text_field :content
.......
.remove-link-option= option.remove_nested_fields_link "Remove option"
= fa.add_nested_fields_link :question_options, "Add option"
= ff.add_nested_fields_link :questions, "Add question", class: "btn btn-primary"
There is no option for that. One way would be to use javascript to trigger the remove link straight after displaying the form.