Iteration H1: Adding Fields Dynamically to a Form
We need a dynamic form that changes what fields are shown based on what pay type the user has selected. While we could cobble something together with jQuery, it would be a bit cleaner if we could use a more modern JavaScript library like React.[66] This will also form a solid base from which we can easily add additional features later.
Using JavaScript libraries or frameworks can often be difficult, as the configuration burden they bear is far greater than what we’ve seen with Rails. To help us manage this complexity, Rails includes Webpacker, which provides configuration for Webpack.[67] Webpack is a tool to manage the JavaScript files that we write. Note the similar names. Webpacker is a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access