Bulk Updates

Episode #447 by Teacher's Avatar David Kimura

Summary

Updating multiple records in the UI of a Rails app could be tricky. In this episode, we'll look at updating multiple records at the same time from scratch. We'll create a Stimulus controller to handle some of the front end functionality.
rails stimulusjs javascript activerecord 18:58

Chapters

  • Introduction (0:00)
  • Creating the Check Boxes (1:23)
  • Adding Check All functionality (2:46)
  • Creating the Bulk Controller (5:51)
  • Creating the Stimulus Function for the bulk edit (8:39)
  • Creating the Bulk Edit View (12:32)
  • Updating the Bulk Records (14:23)
  • Demo (16:32)
  • Default Values (17:05)
  • update vs update_all (17:34)
Student & Teacher
$ 9 /mo

Valid School Email Required

Same Access as Pro

Subscribe Now
Pro Monthly
$ 19 /mo

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Pro Annual
Autumn Sale
$ 144 190 /yr

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Teams
$ 57 /mo

3 Users Minimum

$19.00 / user / month

Same Access as Pro

Subscribe to Teams