Latest Ruby news from the world

1 February 2023

Ruby News January 2023 Digest

Ruby News January 2023 Digest
Ruby News
Feb2023
31 January 2023

Rendering markdown views in Rails

In this post the author explains how to render markdown views in Rails.
Ruby News
Jan2023
30 January 2023

The Difference Between load, autoload, require, and require_relative in Ruby

Loading external files can get tricky in Ruby, but it doesn't have to be. This post explains the usage of Ruby's load, require, and require_relative methods, and when to use each.
Ruby News
Jan2023
27 January 2023

Secure CSRF Token Storage in Rails 7 using Encrypted Cookies

Introduction of Rails 7 feature to store CSRF tokens outside of the session such as in encrypted cookies.
Ruby News
Jan2023
27 January 2023

Rails on Docker

Rails 7.1 is getting an official Dockerfile, which should make it easier to deploy Rails applications to production environments that support Docker. Think of it as a pre-configured Linux box that will work for most Rails applications.
Ruby News
Jan2023
27 January 2023

Uniqueness validation does not work since the beginning of Ruby on Rails

This post is about a problem of uniqueness validation in ActiveRecord. The author shares how to deal with the problem and ensure it does not come back.
Ruby News
Jan2023
26 January 2023

Calling Ruby Methods in C: Avoid Memory Leaks

Discover how you can avoid memory leaks in your C extension by using functions like rb_protect.
Ruby News
Jan2023
25 January 2023

Leverage Regular Instance Variable to Resolve Thread-Safety Issue on Rails ActiveRecord model

The Rails ActiveRecord module allows us to make use of standard instance variables on the objects to adapt their behaviour. In this post we discuss the technique and give an example of where it could be used.
Ruby News
Jan2023
24 January 2023

My Adventure with Async Ruby

Ruby 3.0 introduced the fiber scheduler interface, which is used by the async gem to run tasks concurrently. It’s particularly useful for I/O-bound workloads. This post is a summary of my journey in figuring out how to use it.
Ruby News
Jan2023
24 January 2023

Regex Improvements in the New Ruby 3.2

Last Christmas day, the Ruby 3.2.0 version was released. The author tells improvements to regular expressions and ReDoS (Regular expression Denial of Service) attacks.
Ruby News
Jan2023
23 January 2023

Avoiding bugs in Ruby code using the state pattern

In this article, the author will take you through an example, at first with a brittle implementation, and then reworked using the state pattern into something more stable.
Ruby News
Jan2023
23 January 2023

Simplifying DOM Element Generation in Rails with the Enhanced dom_id Method

Learn how the recent enhancement to the Rails dom_id method allows developers to generate both an ID and a class for an element in a single line of code.
Ruby News
Jan2023
23 January 2023

How to Delete a Directory in Ruby

In Ruby, there are several ways to delete a file or a directory. In this article, we will discuss two of the most commonly used methods: File.delete and FileUtils.remove_dir.
Ruby News
Jan2023
23 January 2023

Super Standard

In this post the author explains how to add gem extensions and custom rules to Standard Ruby.
Ruby News
Jan2023
20 January 2023

A Shallow Dive into Memory Leaks in Ruby

In this post the author explains how to avoid memory leaks in Ruby.
Ruby News
Jan2023
19 January 2023

Refactoring instance variables to local variables in Rails controllers

In this post, the author will show how to take advantage of shorthand hash syntax while changing from instance variables to local variables in controllers and views.
Ruby News
Jan2023
19 January 2023

10 Ruby tricks to improve your code (or not)

In this post the author shows you 10 nice Ruby features to improve your code.
Ruby News
Jan2023
19 January 2023

Server-Side Request Forgery in Rails

In this post the author explains what is Server-Side Request Forgery (SSRF), and why is it a concern for web security?
Ruby News
Jan2023
17 January 2023

Evaluating More Coverage in Ruby 3.2

In this post the author explains how the Coverage module can measure the coverage of a Ruby expression in a string passed to the eval method.
Ruby News
Jan2023
17 January 2023

Signed URLs with Ruby

Signed URLs can be a very useful solution in many cases when you need to provide limited access to some resources or actions. In this post the author will focus on when and how to use them in Ruby, with Rails, or by providing a custom implementation.
Ruby News
Jan2023
12 January 2023

How to create a Ruby on Rails gem from your existing code

A step-by-step tutorial on how we extract code from our Rails app, package it into a gem, and publish it on RubyGems.org.
Ruby News
Jan2023
11 January 2023

Ruby News December 2022 Digest

Ruby News December 2022 Digest
Ruby News
Jan2023
10 January 2023

Applicative programming in Ruby: advanced behaviors

In this post the author shows how to create applicative lists and parsers.
Ruby News
Jan2023
5 January 2023

Rails 7.1 supports infinite ranges for Active Record Validators

In this post the author shows how Rails 7.1 supports infinite ranges for Active Record Validators.
Ruby News
Jan2023