I am sure this is a silly question, but I have been searching for some time now without finding an answer.
I have a nested form using simple_forms. I get all the child objects successfully with
= f.simple_fields_for :fund_levels do |fl|
= fl.input :title
= fl.input :description
= fl.input :maxnumber
= fl.input :price
This gets all existing fund_levels. However, I also want to add a blank set at the end of the list. So that if there are no existing fund_levels, it simply shows a blank “subform”, if there are two existing fund_levels, it will show those two plus a blank “subform”.
Is there an easy way of doing this?
Build it in your controller:
where
@objectis the object being passed toform_for.