I am creating a dynamic form constructor. And I have a problem that I cannot fix.
So, I have a db table called "form" forms can have "fields".
The problem is that when the user creates a new field (click add-field), he must ajax a new field for .. this field.
The problem is that I cannot just do something like this:
<%= Form.fields_for Field.new do |field| %>
<%= field.text_field :name%>
<% end %>
Does anyone have any ideas? Yes, I look at railscasts, yes, I googled, yes, I found a repository of "complex forms" on github.
But no luck (for now)
source
share