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.
Relay mails into ActionMailbox with existing Postfix server
One slightly under-documented ingress for ActionMailbox is using Postfix relaying. It is easy to integrate into an existing Postfix mail server by just adding another virtual_alias_map and also supports Regexp matching of many different mails (so 1 mail per customer easy achievable). Goal is to POST the mail into our App-Server using a small CURL script without adding new dependencies to the MTA server. [more inside]
Web Application Security in Ruby on Rails
Web application security is the cornerstone of protecting your Rails applications from malicious attacks and unauthorized access. Read the full article here - Web Application Security in Ruby on Rails.
Optimize Database Performance in Ruby on Rails and ActiveRecord
Let’s dive into some strategies to optimize database performance in Rails and ActiveRecord: https://blog.appsignal.com/2024/10/30/optimize-database-performance-in-ruby-on-rails-and-activerecord.html
Deploying a Jekyll site with Kamal
If you are like me and you have Jekyll sites that you would like to host alongside your Rails apps, you can deploy them with Kamal 2: [more inside]
Hanami 2.2: Persistence pays off
https://hanamirb.org/blog/2024/11/05/hanami-220/ — With our new database layer and operations, the Hanami 2 vision is complete!
Rails View Patterns: Helpers vs Partials vs Presenters vs Decorators
In my previous post I covered Why use Presenters than Components OR Integerate Them Together so when to use helpers, presenters, partials, and decorators got missed. This article - Rails View Patterns: Helpers vs Partials vs Presenters vs Decorators covers this extensively with code examples from a production app. I hope you enjoy reading the article and get your Rails views organized.
Using GraphQL with LLMs in Ruby
https://workflow.ing/blog/articles/using-graphql-with-llms-in-ruby - Use OmniAI to chat with GraphQL.
Kamal Kitchen Sink
In this episode, we look at creating an entire infrastructure (proxy, load balancer, app servers, worker servers, database server, and a storage server) on our own hardware use Kamal to provision and deploy our Ruby on Rails application. https://www.driftingruby.com/episodes/kamal-kitchen-sink
Ruby on Rails 8 Concurrency Guide: Modern Parallel Processing
Ruby 3 has concurrency and parallelism then how can Rails be behind?! This article explains how we can implement concurrency and parallelism in our Rails 8 apps, and is the continuation to my previous article Ruby Concurrency and Parallelism. Read it here - Ruby on Rails 8 Concurrency Guide: Modern Parallel Processing - to build more faster and scalable Rails apps.
Released tty-link v0.2.0
The newest tty-link implements a brand-new API that supports Alacritty, Kitty, WezTerm, and many more modern terminals. It allows hyperlink detection configuration with a keyword or environment variable.
Ruby Concurrency and Parallelism
I have been seeing a lot of discussion comparing Elixir with Ruby for its concurrency features. The point these discussions miss is that Elixir runs on top of ErlangVM which had concurrency built-in as it was developed for running humungous-large-scale telecom systems. Whereas, Ruby was developed by Matz as a Software Language easy to understand and write. Ruby already had concurrency features through threads and fibers since its 1.9 version and Ruby 3 added parallelism features through ractors. This article covers all these 3 in detail and with a lot of code examples related to even AI and ML. Read it here - Understanding Ruby 3.3 Concurrency: A Comprehensive Guide.
new release of rails_performance gem
https://github.com/igorkasyanchuk/rails_performance has a new release 1.3.0 with CSV export and some other fixes and improvements [more inside]
Why use Presenters than Components OR Integerate Them Together
This article covers a) What are Presenters? b) Why use Presenters c) Presenters vs Components d) How to Implement Presenters e) Presenters vs Decorators. For Rails newbies these are very confusing thus this article removes this confusion and helps new Ruby on Rails developers to learn how to properly architect their Rails 8 apps. Read it here - Why use Presenters than Components OR Integerate Them Together.
Montreal.rb May 2024 - Hotwire Turbo in Rails: Drive, Frames and Streams
The video of the Montreal.rb May 2024 talk “Hotwire Turbo in Rails: Drive, Frames and Streams” by Helmer Davila has been finally posted on YouTube: https://www.youtube.com/watch?v=rmsBVsZUHzI&list=PLRAf4zt5oEjc2mqmEN9m_O0JovQCXxvxt&index=13 [more inside]
Argon2id: Ruby bindings to Argon2
The first public release of new, native, pre-compiled Ruby bindings to the reference C implementation of Argon2, the password-hashing function that won the 2015 Password Hashing Competition: https://github.com/mudge/argon2id [more inside]
Hotwire and HTMX - Same Principles, Different Approaches
I’m an experienced Hotwire user and I also recently read the book by HTMX authors. I found some interesting similarities and differences between the two: Hotwire and HTMX - Same Principles, Different Approaches
The Basics of Rack for Ruby
Rack is the foundation for every popular Ruby web framework in existence. In the first part of a three-part series, let’s set up a Rack app: https://blog.appsignal.com/2024/10/30/the-basics-of-rack-for-ruby.html
How I upgraded my pet project from Rails 7 to Rails 8 in 30 minutes
A step by step description of the upgrade with links to the project itself and commits
Turbo Frames in Rails: A Complete Guide to Lazy-Loaded Components
This article Turbo Frames in Rails: A Complete Guide to Lazy-Loaded Components is the continuation of the previous article on ViewComponent vs Phlex vs Partials.
A practical GitHub Actions pipeline example with Rails
Continuous integration (CI) pipelines are an important part of building and deploying reliable software. Here’s how to set up a GitHub Actions pipeline for Rails.
ruby -run
Ruby is well known as a language that is easy to use from the surface, but is very deep and complex underneath. That’s what we know and love about it as a language, but its standard library has a similar design and as such it contains many hidden gems. One of the gems I’ve learned about recently is un. [more inside]
Guide: Use a Single Form to Create Multiple Nested Models (at once)
How to handle multi-level nested forms, with a StimulusJS solution to add new child items. It uses nested attributes. [more inside]