RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

How to Create Dynamic Form Fields in Rails with Auto-Updates with Hotwire, StimulusJS

Have you ever needed to create dependent fields in a form? Selecting a Country, updates the States select. Or if you select a role (standard/manager/admin) it loads specific fields for the role.

I will share my reusable solution using Ruby on Rails and Hotwire that supports an arbitrary level of “nested dependents”.

Video tutorial: https://youtu.be/TUIR-PYJxlg

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in