mathieuprog / polymorphic_embed

Polymorphic embeds in Ecto
Apache License 2.0
335 stars 62 forks source link

Form functions ignore the configured type_field #77

Closed hexedpackets closed 5 months ago

hexedpackets commented 1 year ago

The function to_form (called by polymorphic_embed_inputs_for) is hardcoded to use __type__ as a hidden field. If the embedded schema is configured with a different type_field, the changeset will be invalid. I'm working around this for now by manually adding another hidden field with the correct field name.

Hidden field for reference: https://github.com/mathieuprog/polymorphic_embed/blob/78e51d90a55d73a0f81a99de1c28316f057d37b8/lib/polymorphic_embed/html/form.ex#L153

woylie commented 1 year ago

see #67, resolved in #68