how to build a complete, real-world application from scratch with Ruby on Rails step by step.
A lot of Ruby code is "magic". We'll explain the magic and see how it works using the powerful tools Ruby gives us.
Accept subscription and one-time payments with Stripe in your Rails apps
Expert advice on keeping Rails apps organized and fast.
Cheap, easy hosting for Ruby and Rails apps.
Launch your product business way faster with our SaaS template.
Find your next Ruby on Rails Job.
Rails uses the Ruby subscript operator to implement versioning with ActiveRecord Migrations. We'll learn how this works and implement it from scratch to see how it all ties together
Errors can come up in many different ways. This episode, we'll look at how we can improve error handling in the noticed gem to cleanly handle issues with ActiveRecord without negatively affecting
I recently became a maintainer of the Sequenced gem for Rails, so this lesson we walk through all the different things for maintaining a gem and making sure it works with the latest Rails versions.
Using Signed GlobalIDs, we can create polymorphic select boxes in Rails to easily choose a record of any type. This is also secured by using signed global IDs to prevent tampering by malicious users.
Rails apps and Rubygems might need to support multiple databases. We can use the DATABASE_URL environment variable to quickly swap out the database that Rails uses in CI, local testing, and more.
Complex queries can slow your page rendering down. We can now run long queries in parallel with Rails 7's load_async method in ActiveRecord to speed up page rendering.
Custom ActiveRecord validations are easy to make and they're implemented exactly the same way as the built-in Rails validations. It's super handy to be able to add nice, clean validations that you can repeat throughout your apps.
ActiveRecord default_scopes are incredibly useful for some features like soft delete. But sometimes we need to undo a scope, so that's where unscope comes in.
Hotwire lets us broadcast changes so we can use the same approach for nested comments, but in realtime!
Testing a gem or your Rails app against multiple Ruby and Rails versions is super useful, but we also take it a step further and test our gem against several different databases too
Drag and drop sortable lists in Rails aren't too hard using Sortablejs and Stimulus to make wire them up to our backend with acts_as_list
We can use timestamps in our database to track of online users in your Rails
Learn how to write tests for validations on ActiveRecord objects in Ruby on Rails
With Rails 6.0, you can now define multiple primary and replica databases, define separate migrations for each primary database, and configure each model to read and write from different databases.
Race conditions can cause problems with data integrity. We can prevent these issues with Pessimistic Locking in ActiveRecord which uses database row-level locking.
When things (users, jobs, etc) attempt to update the same record at the same time, we can often lose changes. Optimistic locking uses a lock version number to warn you about updating stale objects so you can handle that safely.
Mentioning Users with an @mention is a super common feature. Trix and ActionText are now part of Rails 6 which means we can very easily add support for tagging users with @mentions and other custom attachments in your applications.
Don't like Cocoon or it's jQuery dependency? We can use Stimulus JS and build dynamic nested forms in Rails with accepts_nested_attributes_for from scratch pretty easily!
Join 70,078+ developers who get early access to new tutorials, screencasts, articles, and more.
We care about the protection of your data. Read our
Icons by Icons8
© 2023 GoRails, LLC. All rights reserved.