Blog

Ruby

89 posts tagged ruby — the same founder-tested patterns, filtered.

How to use Ruby on Rails Concerns

How to use Ruby on Rails Concerns

A Rails concern is a module that extends the ActiveSupport::Concern module.
How To Setup Default Values For Attributes In Ruby On Rails

How To Setup Default Values For Attributes In Ruby On Rails

Since attributes are uninitialized when a new model is created without any parameters, default values will be set according to the attribute type.
What is the difference between joins and includes in Rails ActiveRecord?

What is the difference between joins and includes in Rails ActiveRecord?

The main difference is that when using includes the eager loading is used.
Pitfalls of using metaprogramming in Ruby on Rails application

Pitfalls of using metaprogramming in Ruby on Rails application

Do you know that metaprogramming is easy to add but hard to support?
Preview UI changes with Ruby on Rails variants

Preview UI changes with Ruby on Rails variants

Here's one of the simplest ways to do it without introducing complex feature switching mechanisms.
Generating random strings with Ruby

Generating random strings with Ruby

When you need to generate a random alphanumeric string of a specified length in ruby you have a couple of options.
Manage Bundler indirect dependencies versions

Manage Bundler indirect dependencies versions

Have you seen that bundler stuck on finding how to upgrade your gems?
How to get & build full URLs in Rails

How to get & build full URLs in Rails

There are some cases when you want to get a current request absolute URL.
How to use a Transaction Script(aka Service Objects) in Ruby on Rails. Simple example

How to use a Transaction Script(aka Service Objects) in Ruby on Rails. Simple example

The logic of small applications can be present as a series of transactions.

Reading this because something is going wrong?

A free code audit gives you a written assessment of your codebase in plain English.

Get a Free Code Audit

Rated 4.8/5 on Clutch · you keep the write-up either way