Look into customizing Formtastic's HTML or replacing it #7875
Replies: 5 comments
-
|
+1 for moving to simple_form |
Beta Was this translation helpful? Give feedback.
-
|
+1 for moving to simple_form |
Beta Was this translation helpful? Give feedback.
-
|
Any thoughts on the possibility of moving to simple_form? |
Beta Was this translation helpful? Give feedback.
-
|
@seanfcarroll yes I think it would be great. Certainly better than formtastic as far as customization goes which would be beneficial. I haven't tried integrating it though so I don't know what to expect but I checked out what it offered and to see if it was being maintained. It would be valuable to experiment integrating simple_form but I figure it would be quite challenging. |
Beta Was this translation helpful? Give feedback.
-
|
It's 2025 and given that formtastic seems to be (semi?)abandoned by the amount of work needed to make it work with Rails 8.1 + Devise5, maybe this is worth revisiting? The migration work surely is daunting, maybe LLM tools can make it easier to get around? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Its been quite painful to style Formtastic's HTML in #3862 that I'd like to update it to use a simpler component based approach like you see in Bootstrap or Foundation. I very much like Bootstrap's approach of using a
form-controlclass instead of targeting HTML elements and applying defaults. Further styling fieldsets is incredibly painful across browsers. We have a panel component in #3862 which we should be reusing there. Or just using a different presentation for form headers.We can customize the HTML output but it would require that we subclass each input class and override the
input_wrappingmethod to use a new approach. Although the problem is that the fieldset_wrapper.rb helper generates not just the<fieldset>element but the<ol>as well which isn't good.Further digging shows that
form_builder.rbactually opens up theFormtastic::Inputs::Basemodule to override theinput_wrappingmethod which for me was unexpected.A good idea which could be quite challenging is switching to simple_form which is maintained and better documented. It has easier way of namespacing and customizing without having to subclass everything. It was built with customization in mind.
Beta Was this translation helpful? Give feedback.
All reactions