Author name: David B

Ruby Split Array

Split is a very common method not only in Ruby, but also in the programming world. Let’s see what does .split means for a Ruby Array. Split method for a Ruby array Let’s start with a simple example : Yikes! It returns a 2D-Array. After all, it’s logical because you have asked to separate the …

Ruby Split Array Read More »

Sort a Ruby array

A short article about how to sort an array in Ruby. It’s a classic problem in other languages too, so let’s explore the Ruby case. Nature of arrays As we have seen in other blog entries, arrays and hashes are basic concepts in any programming language. It is the best way to encapsulate and organize data. …

Sort a Ruby array Read More »

Ruby multiline String

We will explore multiple scenarios where the display of a simple String in Ruby on multiple lines could be useful. What is a multiline string ? A multiline string is a string that, when displayed, returns the output in more than one line. With Ruby, there are different ways to create multiline strings. In this …

Ruby multiline String Read More »

Rails pundit tutorial

Authorization is an important part of any SaaS. Let’s see what it means, and how to implement it with the pundit gem for Rails. Introducing Pundit As you probably know, web applications need the ability to assign different roles and permissions. New developers often confuse two terms – Authorization and Authentication. Authentication is a method of granting access to …

Rails pundit tutorial Read More »

Ruby ternary operator

Many languages have a ternary operator, including Ruby. The goal is to reduce the size of the code by displaying a one-line condition. Let’s see how. Intro Operators are a basic tool in programming languages. The main ones are arithmetic and comparison operators. Ruby includes the ternary operator, which encapsulates both: an if statement and a comparison in a single …

Ruby ternary operator Read More »

Ruby Substring

Ruby is an elegant and dynamic language. Today a simple topic about how to extract a Substring from an existing String in Ruby. Ruby String Strings are one of the main and most used classes in programming languages. A string is a container of character sequences. Typically, strings represent text, but they can encapsulate any character …

Ruby Substring Read More »

Ruby-on-Rails authentication tutorial with Devise

Ruby-on-Rails has no built-in authentication mechanism. So let’s pick the well-known gem Devise in this tutorial. Rails authentication Ruby-on-Rails lack of internal, built-in authentication mechanism is something often claimed by developer for the next Rails version. Devise seems the go-to, default gem for authentication, despite being heavily discussed on forums (like this Reddit discussion). For bootrails we …

Ruby-on-Rails authentication tutorial with Devise Read More »

Ruby vs JavaScript

Ruby and JavaScript and two fantastic languages for the web. Let’s see the difference between them, to help you to learn Javascript if you know Ruby, and vice-versa. JavaScript and Ruby are beautiful ❤ The choice of the programming language will definitely affect what projects you will create and what companies you will be able …

Ruby vs JavaScript Read More »

Scroll to Top