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.
A weekly podcast on web development and building products with Ruby, Rails, Javascript, and more.
Build a Ruby on Rails app in 48 hours with us.
Help Junior developers get hired by sharing small projects to build their resume with paid work.
Find your next Ruby on Rails Job.
We don't want to save passwords in plaintext in our password manager's database. That would be insecure. Luckily Rails provides ActiveRecord Encryption to make this easy.
Our first step in building any application is designing what database models we will need to store our data.
Normalizing data has always been a pain in Rails, but not anymore! Instead of callbacks or overriding setters, Rails 7.1 introduces "normalizes" to make normalizing data easy.
ActiveRecord Aggregations let you use composed_of to combine columns into a single attribute using a Ruby object.
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
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.
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.
Rails' ActiveRecord supports virtual generated columns in the database. For example, you can use these for converting numbers like degrees Celsius to Fahrenheit. These columns are saved with the regular table data and allows you to query against them.
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
Hotwire lets us broadcast changes so we can use the same approach for nested comments, but in realtime!
Creating draft records in your database can be tricky. We'll be using the Draftsman gem to help us create draft versions of our records with our autosave Javascript
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 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
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.
Updating slugs
Nested comment threads pose a lot of unique challenges. One of these is deleting comments because you can easily lose the child comments or context. We'll take a look at a couple great ways of handling this.
Adding pagination to our nested comment threads is easier than you might think, plus we'll take a look at a couple different approaches we can use
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.
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.
We can use timestamps in our database to track of online users in your Rails
Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.
We care about the protection of your data. Read our Privacy Policy.