Ruby 2.6.1
Rails 5.2.2
Simple Form 4.1
Currently, Simple_form uses type-for-attribute to map the field types. https://github.com/plataformatec/simple_form#available-input-types-and-defaults-for-each-column-type
However, if you delegate the form object to two or more models, simple_form does not know how to map it. You can use
delegate :type_for_attribute, :has_attribute?, to: :car
delegate :type_for_attribute, :has_attribute?, to: :repair_center
However, the top delegate is lost when the bottom delegate is introduced. Hence, there needs to be a better way to map the type_for_attributes to the correct model.
Basically, a feature request, or if the feature is already available, please let me know.
-- EDIT
In my original request, I needed to find a way to call type_for_attribute on multiple models. I ended up writing a method that looks at the model the field is delegated to and calling type_for_attribute on that model to get simple form to see the types.
@joshm1204 I would suggest not editing your issue the way you did. Even if you might consider your issue "wrong" or "useless", it's undoubtedly even more useless when you replace all the text with "REMOVED". There's always the chance someone made the same mistake you did. Just a note for the future.
Yeah, I'd suggest the same. Also, would be awesome to share why it's not an issue anymore. It could help others in the future.
Thanks :)
updated, I hope this is useful.
Most helpful comment
updated, I hope this is useful.