The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Yesterday
Run and roll back migrations via UI
Tired of using the CLI for running and rolling back migrations? There is a solution for you. The recent release of actual_db_schema (v0.7.6) provides a web UI to list, view details, migrate, and roll back your schema migrations. With zero configuration, simply install the actual_db_schema gem, visit http://localhost:3000/rails/migrations, and enjoy. In addition to the actual migrations, it will also show the phantom ones (those that were migrated in feature branches) that can be rolled back with just one click. Watch a short video in this tweet that shows all that in action.
Integrating Sidekiq with Async
In this post I explain how you can have persistent connections to Redis using Async::Redis client inside Sidekiq and why it doesn’t work by default. There are some basic explanations of how Async and Sidekiq work and some source code.
What's Coming in Ruby on Rails 7.2: Database Features in Active Record
Let’s take a look at some noteworthy changes in Ruby on Rails 7.2, particularly in Active Record: https://blog.appsignal.com/2024/07/24/whats-coming-in-ruby-on-rails-7-2-database-features-in-active-record.html
Hash Value Omission - an introduction
I wrote a detailed article about hash value omission feature where I describe how it works, why to use it, what were the arguments to accept the proposal and a performance trick it enables.
How to build an image gallery in Rails with Stimulus
Learn how to create an interactive image gallery in Rails with Stimulus in this 7-minute video lesson. You will learn the basics of how Stimulus works and then build a Stimulus controller for highlighting different images on an ecommerce store’s product page. There’s also a full text transcript with code snippets.
How to use CSS in Rails 7
This article shows you 6 ways you can use CSS in Rails 7 applications, including sprockets, third-party stylesheets, SASS, Tailwind, Bootstrap and Propshaft.
Ronin 2.1.0 has finally been released!
Ronin 2.1.0 has finally been released! This release includes a lot of new features, such as new database tables, new payloads, a new recon engine, a local Web UI, and more.
First cut of Everyday Rails Testing with RSpec, Rails 7.1 edition, now available
Hello friends, I’ve finally released the first four chapters of my Testing with RSpec book, Rails 7.1 edition! You can read the announcement on Everyday Rails. The book includes the first four chapters, a brand new sample application, and a shiny new cover. I hope you’ll check it out and let me know what you think.
Event sourcing for smooth brains: building a basic event-driven system in Rails
Event sourcing is a jargon filled mess, but we can build a lean version with just ActiveRecord, callbacks, and a bit of boring code. Learn how to create simple, yet powerful event-driven systems in Rails. [more inside]
An Introduction to Auth0 for Ruby on Rails
This article will cover the setup and use of Auth0 in a Ruby on Rails application: https://blog.appsignal.com/2024/07/17/an-introduction-to-auth0-for-ruby-on-rails.html
A new interactive mode for Bundler
Announcing bundle_update_interactive, a new gem that adds a nifty update-interactive
command to Bundler, inspired by yarn upgrade-interactive
. Browse the gems in your project that need updating, identify the ones affected by security vulnerabilities, and see risks at a glance with semver color highlighting. Having second thoughts about an upgrade? A changelog link is displayed for each gem so you can dive into the details. More docs and screenshots in the README: https://github.com/mattbrictson/bundle_update_interactive
Access Request Headers in a Rails Controller
How do you access request AND response headers in a rails controller? What does the headers method refer to? Let’s dive into the Rails source code to investigate a failing rspec request spec. [more inside]
Exercise: Minesweeper in 100 lines of clean Ruby
I like how in Ruby you can often use less lines of code and at the same time increase readability. So as an exercise, and for fun, I did that with Minesweeper: Exercise: Minesweeper in 100 lines of clean Ruby
Custom color schemes with Ruby on Rails
This blog post lets you edit your preferred color scheme of the whole site. The article not only talks about the some of the benefits of Rails, Hotwire, and CSS variables but shows you as well with a “colorful” live demo. [more inside]
Prefer endless method by Synvert
It demonstrates how to use synvert to convert traditional method to endless method. https://synvert.substack.com/p/prefer-endless-method-by-synvert
Rails 7.2 Adds app:update Task to be a Rails Command.
Puma-dev and using it with Rails applications. [more inside]
New gem for tracing Active Record queries
Presenting a new gem for tracing Active Record, I wish existed earlier - https://github.com/fatkodima/active_record_tracer [more inside]