Save 36% for Black Friday! Save 36% on GoRails for Black Friday! Learn more →
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.
A few of the Open Source projects we do at GoRails.
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.
Add liking or favoriting to your app like Facebook or Twitter
An introduction to Ruby on Rails ActiveSupport concerns where we build a Soft Deletable module like the Paranoia gem
Learn how I discovered and solved a performance bug in OneMonth.com's view partial
Learn how to schedule posts in draft, published, and scheduled modes
Learn how to use ActiveRecord Transactions to create atomic updates across multiple records and to improve the speed of bulk operations
Use ActiveRecord::Store and ActiveRecord-TypedStore to save user preferences and settings to a single column in the database
How to build nested comments and threads in Ruby on Rails
Implementing polymorphic, reusable comments across models and limiting the nesting allowed for nested comment threads
Using AJAX, we can submit our comments and have them render onto the page without a page refresh.
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
Autosaving draft records allows you to make sure users don't lose their work and can easily write draft content without publishing right away. We'll be using Stimulus to build an autosave controller for our form and Draftsman to power the backend.
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
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!
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.
Race conditions can cause problems with data integrity. We can prevent these issues with Pessimistic Locking in ActiveRecord which uses database row-level locking.
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
Updating slugs
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.
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.
Join 87,110+ developers who get early access to new tutorials, screencasts, articles, and more.
We care about the protection of your data. Read our Privacy Policy.