Skip to Main Content
Modern Front-End Development for Rails, 2nd Edition
book

Modern Front-End Development for Rails, 2nd Edition

by Noel Rappin
September 2022
Intermediate to advanced content levelIntermediate to advanced
410 pages
10h 7m
English
Pragmatic Bookshelf
Content preview from Modern Front-End Development for Rails, 2nd Edition

Using Stimulus to Manage Forms

Turbo is designed to allow regular form submissions to trigger interactive changes on a page without having to reload the entire page. Sometimes, though, you need a little more client-side zest. You might want the form to be submitted on a user action other than clicking a Submit button. Or you might want to gather data from elsewhere on the page. In either case, you can use Stimulus to mediate your form submission.

If you look at the schedule page of our application, it has a search bar that currently does nothing except maybe offer typing practice. What we’d like it to do is return search results on typing. Specifically we want the following functionality:

  • Typing in the box triggers a form submission with search ...

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.
Start your free trial

You might also like

Modern Front-End Development for Rails

Modern Front-End Development for Rails

Noel Rappin

Publisher Resources

ISBN: 9781680509977Errata Page