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.
[Judoscale] Autoscaling Heroku: The Ultimate Guide
So you’ve got your app up and running on Heroku, your web dynos are happily serving requests, and everything is smooth. Traffic is growing steadily, your SEO juice is increasing, sales seem to be on the up and up! But eventually the alerts begin… [more inside]
Early bird tickets for Rocky Mountain Ruby conference end tomorrow (8/15)
I’m thrilled to be giving a talk at Rocky Mountain Ruby about how I built the licensing and distribution for my “Ruby on Mac” product with Ruby, Rails, and SwiftUI. [more inside]
Introducing Line Range Filtering in Rails 7.1 Testing
Rails 7.1 introduces line range filtering for running specific tests within a test file based on line numbers. https://blog.saeloun.com/2023/08/14/rails-7-filter-test-by-line-range/
Why I’m sticking with Rails, at least for now.
This is my journey with two leading web development frameworks: Rails and Elixir. Having invested years in Rails, I ventured into Elixir, captivated by its claims of high performance, resilience, and distributed systems. I admired Elixir and its Phoenix framework but encountered complexities when revisiting past code. On returning to Rails, I experienced greater intuitiveness and efficiency, especially with the innovative Hotwire design. Despite the unique advantages of Elixir, such as its Ecto library for complex queries, I felt more aligned and efficient with Rails. Ultimately, I decided to rewrite my Elixir-based project, Rauversion, in Rails, completing 90% in just two weeks, and I’ve had the opportunity to contrast the strengths and weaknesses of both ecosystems. [more inside]
pixelart gem in action - Bixel and Biixel Image class for paint by number or letter
is it ordinal summer? i’ve written-up a step-by-step guide to define your own paint by number or letter image class - using the bixel (7x7px - 10 colors) and biixel (10x10px - 21 colors) specs / protocols as real-world examples. happy pixel (or bixel or biixel) pushing with ruby.
Eloquent code needs no comment
Comments are often a tell that the code could be more explicit. Every time I write a comment, I refactor my code to be understandable without it : http://alexis.bernard.io/blog/2023-08-11-eloquent-code-needs-no-comment.html
Sharding in Rails 7: A New Horizon in Database Management
Looking to scale your Rails applications? Dive into the world of sharding with Rails 7 in this comprehensive guide. From automatic role switching to horizontal sharding, this article explores the tools and techniques to efficiently manage large-scale applications. Check it out at https://psmy.medium.com/sharding-in-rails-7-a-new-horizon-in-database-management-6527e34ea8d8 and stay ahead of the curve!
Preview emails in Rails with letter_opener, MailCatcher and MailHog 🐷
I recently published an article diving deep into previewing your ActionMailer emails — Preview emails in Rails with letter_opener, MailCatcher and MailHog
Trailblazer Tales #07 explains nesting
In the newest episode we’re back with a video of how to nest operations in Trailblazer. https://www.youtube.com/watch?v=kEYSIda7UHY
Rails has_one Nested Attributes Tweaking
When it comes to Rails nested attributes and has_one
relationships, things can get a little weird. This article mentions a few options that you might want to fiddle with in these situations. https://goodenough.us/blog/2023-08-07-til-rails-has-one-nested-attributes-tweaking/
Video: Integrate ChatGPT with Rails 7: Step-by-Step Tutorial
I provide a comprehensive guide to building a Ruby on Rails frontend that interfaces with OpenAI’s ChatGPT. Covering user management, conversation creation, and the ability to continue conversations at any time, this tutorial is tailored for both new and experienced developers eager to embrace the power of AI-driven communication. Watch the video here: https://youtu.be/_3AsaXoLdj4.
Ruby's bang methods - Handle with care!
In Ruby, method names can be suffixed with !. These are often called “bang” methods. This is used to indicate that it is a dangerous counterpart of the non-bang version of the method. [more inside]
Maquina, the engine for Rails
Building apps over time, I found some work that needs to be done on every application: Authentication, Authorization, Mailers, etc. I started extracting this standard functionality into a Rails engine a few years ago. Later, tailwindscss, hotwire, stimulus, and phlex entered the picture, so I started the engine again with reusable UI patterns that take advantage of these tools. This is how Maquina was born. https://mariochavez.io/desarrollo/2023/08/08/maquina-the-engine-for-rails/
Rubidity - A Ruby Dialect for Dumb (Blockchain) Contracts
Hello, some years ago I published a red paper to introduce sruby - Small, Smart, Secure, Safe, Solid & Sound (S6) Ruby to the world with a runtime (and gem) called universum. Now fast-forward and middlemarch (a.k.a. Tom Lehman) introduced dumb contracts on ethscriptions with the production code written in a dialect of Ruby called “Rubidity”. Q: Why do you choose ruby for dump contracts? A: Because you can create a mini-language that’s very similar to Solidity and will be easier for Solidity devs to use. Hear. Hear. Update I started a rubidity sandbox to experiment and study and learn together. join us.
Safe redirects in Rails 7
When enforcing canonical URLs, sometimes I find myself wanting to perform a redirect while retaining most of the params. It’s tempting to use params.merge
to build the redirect in this case, but this is risky from a security standpoint. In this article I’ll explain how to perform redirects like these safely in Rails 7. https://mattbrictson.com/blog/safe-rails-redirects
Materialized views in Rails
https://raghu-bhupatiraju.dev/implementing-materialized-views-in-rails-ffea22bd5d9c
Pre-orders are live for RailsNotesUI ActionMailer components! 📬
I’ve just launched pre-orders for https://railsnotesui.xyz , where I’m building a component library of ActionMailer email components. Rather than hard-coding HTML <tables>
, you’ll be able to build emails with ViewComponents like Email::Button
and Email::Footer
. [more inside]
ordinals gem v1.3 update - now incl. doginal shibescription api. much wow
is it doginal summer? i’ve updated the ordinals gem - a light-weight (free, no api key required) ordinal api wrapper / client for inscriptions (letting you fetch metadata and content) and bonus the new version 1.3 now includes support for doginal shibescriptions (via wonky-ord.dogeord.io). much wow! very happy data analytics and pixel pushing with ruby.
Simplifying UI Testing with data-testid in RSpec & Capybara
Revisiting UI testing approaches, I’ve shifted to using data-testid
for better efficiency and robustness. My new blog post dives into how you can use it with RSpec & Capybara and introduces custom matchers to help. Check it out.
[Screencast] PDF Reader
When previewing PDF files that were uploaded through Active Storage, we can only get a simple image of the first page. In this episode, we’ll look at taking the uploaded PDFs and interacting with them. https://www.driftingruby.com/episodes/pdf-reader
Skipping the console with Rails Runner
Hey RubyFlow, I recently published an article on skipping the rails console with rails runner. [more inside]