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.
Things that surprised us in Postgres-schema multitenancy
You can implement multitenancy in various ways. In one of our projects we went for schema-based multitenancy, where each tenant has its own PostgreSQL schema - i.e. its own namespaced set of tables. I like this particular feature of Postgres, but one has to admit it introduces a little bit of complexity - after all it’s not a conventional feature everyone uses. [more inside]
Currency Calculations in Ruby
You’re doing some currency calculations in your app. It seems to be working well. But after a while, strange discrepancies emerge. The books stop balancing. People get mad. All because the code treated currency like any other number. In this article, Julio Sampaio shows us which of Ruby’s number classes are unsuitable for currency, and walks us through better options.
An Unofficial Active Admin Guide
An in-depth guide on the popular admin gem and libraries it is based on. Learn how to build custom components, inputs, filters, and extend default controllers’ behavior.
An Indie Hacker's Guide to Google Analytics in a Rails App [YouTube]
This video demonstrates some of the workflows I use to make technical and business decisions - e.g. what percentage of users are on mobile, what’s the financial worth of a session etc. [more inside]
How to Use a Static Site Generator as a CMS Engine [VIDEO]
This video explains how to use Static Site Generators like Jekyll, Refinery, and other Ruby on Rails solution. And will advise you which one is best. Enjoy!
Adding Tables to ActionText With Stimulus.js
ActionText is a really flexible framework that lets you embed any kind of model, even interactive table editors! Follow along as I build on a Railsconf talk to show how to add editable tables to your ActionText form with Stimulus.js
Do more with rails console by configuring ~/.irbrc 🎉
How to add methods which you use daily basis in your ~/.irbrc file to boost your productivity
Life beyond the cargo cult
A story about coming to terms with past naivety and why/how we switched from RSpec to TestUnit…without actually switching!
AppleAuth: Ruby Gem for Apple Sign in Rails Integration
Hi! I’ve just published a new post on the Rootstrap blog about AppleSignIn
How to resize and crop ActiveStorage variant
medium.image.variant({ combine_options: { resize: "400x300^", crop: '400x300+0+0' }})
[more inside]
Building a Ractor based logger that will work with non-Ractor compatible code
I wrote a post about building a Ruby 3 Ractor based logger that will work with no-Ractor compatible code: [more inside]
Modern command line alternatives for Ruby developers
I wrote a post on Everyday Rails about my favorite modern command line alternatives for customizing my prompt and several tools I use for more productivity on a daily basis.
How to Fix PostgreSQL Performance Issues with PG Extras
PostgreSQL database queries are a common performance bottleneck for web apps. Before you resort to more complex optimization techniques like caching or read replicas, you should double-check if your database engine is correctly tuned and queries are not underperforming. In this blog post, I present a step by step guide on using PG Extras library to spot and resolve common PostgreSQL database performance issues. [more inside]
Rails Monolith towards Engines spike - The experience of a ten-people team
Why we settled on keeping a Rails monolith, instead of going for separation using Rails Engines.
The Complexity of Active Record Transactions
A critical dive into the implementation differences of database transactions between Active Record and Sequel.
Upload files to Amazon S3 using Active Storage with Securely Storing Credentials
Rails 5.2 comes up with inbuilt feature called Active Storage for the same purpose i.e File uploading which is much simpler than existing options.
Tracking PaperTrail versions while saving in batches
The article explains how to efficiently track and query PaperTrail versions while saving multiple models in batches.
Reading gems’ source code
I regularly use the command “bundle open” to understand how a gem works. This article explains how/why I use that command.
Radio Selection Unselect with Stimulus.js
I recently found myself wanting to be alerted on an unselect action so that I could change what was displayed on the page. A small Stimulus controller that waits for the selection event, and emits its own event that other radio button controllers will receive was the perfect solution!
My Website Relaunch
I just published a story about how I lost my website domain, what was happened with it and how I have relaunched my website.
Sort Rails Records Using Enum Value
Learn more about how to sort records in custom order by enum value in rails. Contact us to build web and mobile app to add value to business.
Managing Bundler and Rubygems with Ansible
If you use Ansible for your Ruby setups, and want to install and freeze Rubygems and Bundler, this will come handy.