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
Building a simplified version of Instagram is a great way to learn Rails.
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.
Translate your Ruby on Rails apps.
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.
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!
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.
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
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.
Using AJAX, we can submit our comments and have them render onto the page without a page refresh.
Implementing polymorphic, reusable comments across models and limiting the nesting allowed for nested comment threads
How to build nested comments and threads in Ruby on Rails
Join 38,311+ 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
© 2020 GoRails, LLC. All rights reserved.