Episode

Опубликовано: 01 Сентябрь 2024
на канале: Drifting Ruby
994
like

Large forms can be overwhelming to fill out, especially if not all of the fields are required. In this episode, we'll look at creating a stimulus controller to conditionally display fields based on the input of another field.

► Full Episode - https://www.driftingruby.com/episodes...

00:00 - Introduction
02:45 - Generating the scaffold
03:19 - Enum deprecation notice
04:05 - Inline Fold Extension config
04:52 - Creating the Stimulus Controller
05:58 - Adding Event Listeners
06:27 - Adding a destructor
06:48 - Starting the core business logic
07:25 - Simple hiding example
08:16 - Applying the inputs to the view
09:08 - Conditionally showing the field
12:26 - Extracting the value
15:26 - Copy/Pasta Fail
16:18 - Addming another Event Listener
16:37 - Toggling a boolean
17:54 - Toggling a select
19:56 - Final Thoughts

This episode is sponsored by Honeybadger (https://www.honeybadger.io/)

► Visit the Merchandise Store - https://www.railsstore.com/
► Ruby on Rails Templates - https://www.rubidium.io
► Subscribe to Drifting Ruby at https://www.driftingruby.com/subscrip...

#ruby #rubyonrails #programming #code #hotwire #javascript #development