Want more GoRails?

GoRails is packed full with over 350 lessons just like this one.

Sign up to get full access or log in to your account and sit back.

Bulk Operations in Rails

#369 ยท November 4, 2020

Your Teacher

Hi, I'm Chris. I'm the creator of GoRails, Hatchbox.io and Jumpstart. I spend my time creating tutorials and tools to help Ruby on Rails developers build apps better and faster.

About This Episode

Bulk operations like "delete all", "publish all", etc require a little bit of Javascript and a special controller for handling them.

Notes

Bulk operations like "bulk delete" or "publish all" are pretty easy to build in Rails. We can use a Stimulus controller to handle the Javascript side of things to manage our "Select All" and check boxes and simply submit those over to Rails. We can also spin up a new controller to keep bulk operations nicely organized and separate from our regular controller.

Resources

Want to stay up-to-date with Ruby on Rails?

Join 74,071+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.