Рет қаралды 6,371
In this video, I'll show you a neat trick to swap out form fields dynamically using Turbo Frames and a tiny bit of stimulus JS (only ~5 lines). This is something I've used on a few production projects and comes in handy on your Hotwire Rails apps.
You can follow along with the source code before this tutorial:
github.com/phawk/coinfusion/t...
And the finished code is here:
github.com/phawk/coinfusion/t...
Chapters
00:00 Intro
00:17 Example Scenario
01:23 Setting Up Fields
02:30 Turboframe Wrapper
03:50 Adding Navigation Controller
05:12 Controller Params
06:34 Testing Toggle Function
07:37 Conclusion
If you like this content, please consider subscribing to the channel.
---
Has this video helped you out? Consider buying me a coffee to say thanks and support future content like this, thanks!
app.payhere.co/rapid-ruby/buy...
You can also find more content like this, including premium courses and exclusive community and mentorship to help you level-up! Head over to rapidruby.com and use the code RRKZbin for a discount!