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.
HTTPX (0.1.0) - an HTTP client
HTTPX is an http protocol client library in ruby which supports concurrent requests (using HTTP/2 and HTTP/1 protocol features), modular features and a simple API.
How to Use the Ruby Map Method
I think it’s so cool that the Ruby map method exists. It means that Ruby has support for higher-order functions, and functional programming. [more inside]
How to Use Strings in Ruby
I remember when I first heard about strings. I wanted to create a command line application that would ask the user for his name and age. Read it here
Scoping records to the current account in Ruby on Rails applications
A simple approach to ensure that user can only modify their own records in a Ruby on Rails application. [more inside]
E-Commerce on Rails: Inside Shopify's Tech Stack
Shopify is one of the oldest and largest Rails apps in existence. Today, they power over 600k online stores. This is how they’ve managed to scale with Rails.
Your business rules are objects too
Have you ever struggled to place a method that seems like it belongs equally well in either of two different classes? In this newly-free screencast from the RubyTapas archives, you’ll see a new way to think about ambiguously-homed methods.
Rails 5.2 added method write_multi to write multiple entries to cache store
Before 5.2 it was not possible to write multiple entries to cache store in one shot even though cache stores like Redis has MSET command to set multiple keys in a single atomic operation. Rails 5.2 adds method that allow us to set multiple entries at once. [more inside]
Custom Exceptions in Ruby
Almost everything in Ruby is an object, and errors are no exception. Learn to create your own exceptions in AppSignal Academy # 18 https://blog.appsignal.com/2018/07/03/custom-exceptions-in-ruby.html
Learn How to Use Ruby Arrays in Less Than 10 Minutes
Arrays are probably the most popular data structure you’re going to use in Ruby. Learn what you can do with them and how to use them effectively. Read it here
[Screencast] Editors
One question that I get asked most often is what editor, theme and extensions am I using for my editor. In this episode, we take a look at the different extensions and settings that I use. https://www.driftingruby.com/episodes/editors
Visualizing and optimizing JavaScript bundle size in Rails/Webpacker apps
This step-by-step tutorial will teach you how to analyze JavaScript bundle size compiled by Webpacker and will demonstrate a few configuration tweaks that could reduce the resulting JS size by hundreds of kilobytes.
Ruby on Rails Deploy Explained: Deploy to Dokku
A quide on how to deploy your Ruby on Rails app to Dokku, including the core aspects of setting a hosting account, swap, configuration, installing plugins, SSH deploy, redeploy and management.
How to Use the Each Method in Ruby
When it comes to doing the same thing over and over again, Ruby has a few methods you can choose from. But in this article, we’re going to look at the each method and what you can do with it. Read it here
Golang for Rubyists. Part 7. Comparison of useful methods in Ruby and Golang
A new article in the series about Golang from Rubyist’s perspective. http://zonov.me/golang-for-rubyists-part-7-ruby-and-golang-methods-comparison/
Identifying randomly failing tests with RSpec bisect
When you have tests that sometimes pass but also sometimes fail, it’s often because one of your supposedly independent tests isn’t tearing down properly. Manual debugging could take hours – but rspec --bisect can help narrow down the cause really quickly. https://medium.com/@scottm/find-the-cause-of-randomly-failing-tests-with-rspec-bisect-dfe9ee2a70c2
Understanding Boolean Operator Precedence in Ruby (&&, and, ||, or)
Operator precedence might be one of the most confusing parts of the Ruby language. Even the docs recommend you just use && and ||. Read it here
Monitoring Rails applications with Datadog
This guide walks you through how to use Datadog to collect metrics, request traces, and logs from a Rails application running on Passenger, Apache, and MySQL.
Rails Authentication Routing Constraints Considered Harmful
This post is from the considered harmful series where we talk about wrong way of doing things.
Writing Testable API Documentation Using APIB and Dredd
In this tutorial, we will use the DDD (documentation-driven development) approach to writing a kind-of-mocked Rails API application. We will set up extensive documentation testing using a combination of Rails API (our framework of choice), API Blueprint (as a language describing our API endpoints) and Dredd (a tool to test API endpoints against documentation). Read it here
How To Learn Ruby
I first stumbled upon Ruby in 2007. All I wanted back then, was a language that I can build something cool with. I was going from knowing nothing to knowing something, so the information had to be as jargon-free as possible Read it here
How to Write a Case Expression in Ruby
Ruby uses the case for writing switch statements. Learn how case works and how you can use it. Read it here
dry-rb: dry-monads 1.0 released
Release announcement for the first dry-rb gem to make 1.0.
Ruby’s Powerful Method Arguments & How To Use Them Correctly
In this article you’ll learn about the variety of method arguments in Ruby, which ones to use & why, and you will learn about the rare “catch-all” argument type! https://www.rubyguides.com/2018/06/rubys-method-arguments/
Sidekiq-ifying Emails at Reflektive
A post about how we improved email delivery and monitoring with Sidekiq at Reflektive [more inside]