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.
[Screencast] Benchmark Ruby Code
It’s easy to accidentally write slow code in our applications. In this episode, we look at how we can benchmark our code and examples of some methods which are slower than others. https://www.driftingruby.com/episodes/benchmark-ruby-code
Dockerizing a Ruby on Rails app with a PostgreSQL Database
These are the configurations I use to deploy a dockerized Rails 6 app. Note that this is a small hobby app so I’m using docker-compose to deploy it, for more serious apps you’d want to use docker swarm or kubernetes.
Full page caching in Rails with a memcached cluster and middleware
A little while ago I wrote a post on how to implement full page caching for a Rails app using Nginx and Redis; I have since replaced the single Redis instance with a memcached cluster and a middleware instead of Nginx to improve scalability and simplify things by removing some dependencies. Post: https://vitobotta.com/2020/10/04/full-page-caching-in-rails-part-2-memcached-and-middleware/
Rebuilding Redis in Ruby - New Chapters
Rebuilding Redis in Ruby is a free online book, where we rebuild Redis, in Ruby, from scratch. [more inside]
Glimmer DSL for SWT 4.17.2.1 Hello, Custom Widget/Shell!
Glimmer DSL for SWT 4.17.2.1 (JRuby Desktop Development GUI Library) has been released: https://andymaleh.blogspot.com/2020/10/glimmer-dsl-for-swt-41721-hello-custom.html
Installing Ruby with ruby-build and ruby-install
Find out about the differences between ruby-build and ruby-install. Which one should you install for development and which one for production?
PostGIS vs. Geocoder in Rails
This article compares PostGIS in Rails with Geocoder and highlights areas where you’ll want to (or need to) reach for one over the other: PostGIS vs. Geocoder in Rails
Rails Application performance impovement
Are you concerned about your Rails Application performance? My new article may help you. Read it here: https://medium.com/@mayurt20/apexit-04-how-to-increase-the-performance-of-your-rails-application-part-1-afa073e72e9a?sk=63cb4f728654064fca1223bb780af7dc.
Joining polymorphic associations in ActiveRecord
Short list of thoughts on how to join polymorphic associations in ActiveRecord and why it cannot be loaded eagerly https://veelenga.github.io/joining-polymorphic-associations/
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. https://www.honeybadger.io/blog/ruby-currency/
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. https://skryukov.github.io/rails/activeadmin/2020/09/29/an-unofficial-active-admin-guide
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. https://www.youtube.com/watch?v=ErZ84NJcL_A [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! https://blog.railwaymen.org/static-site-generator-cms
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 https://onrails.blog/2020/09/30/adding-tables-to-actiontext-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 https://rishiip.dev/p/do-more-with-rails-console/
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! https://sourcediving.com/life-beyond-the-cargo-cult-14964dbb6854
AppleAuth: Ruby Gem for Apple Sign in Rails Integration
Hi! I’ve just published a new post on the Rootstrap blog about AppleSignIn https://www.rootstrap.com/blog/ruby-gem-apple-sign-in-rails-integration/
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.