This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Need a Rails Guide on Dynamic Forms with Hotwire #51668
Labels
You can continue the conversation there. Go to discussion →
This is for the doc effort.
One of the things I see questions on the most in things like Reddit forums and conversations with engineers who have been doing React a lot is how to do dynamic forms in Rails. In this context, I mean dynamic to mean things like having the choice of one field alter the other fields available or their options.
My company went through 3 iterations to get to a pattern we really like on this wherein we have a
refresh_form
action that re-renders our form partial for both New and Edit forms, with a stimulus controller that we attach to any field we want to trigger such a dynamic changing of the form. However, herein lies the real point: we had to set a standard for this ourselves, and there is no Rails Way for it that is documented.This is a massively common use case, and having a Rails Guide for it that started to establish a Rails Way would be great. I suspect we would see some more pre-canned functionality to simplify this use case, but just the docs would be massively productive.
The text was updated successfully, but these errors were encountered: