I can't figure-out how to get at the underlying object in a form_for or field_for block.
What I'd like to do is something like:
<% f.fields_for :children do |child_form| %>
<%= render :partial => "#{child_form.underlying_object.class.name.downcase}" %>
<% end %>
and :children is a polymorphic has_many association.
Suggestions?
Isn't it just
<% f.fields_for :children do |child_form| %>
<%= render :partial => "#{child_form.object.class.name.downcase}" %>
<% end %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With