Use dry-validation gem.
In Ruby, we use
#concat to append a string to another string or an element to the array. We can also use
#prepend to add a string at the beginning of a string.
I’ve never met a developer who complained about code getting faster or taking up less RAM. In Ruby, memory is especially important, yet few developers know the ins-and-outs of why their memory use goes up or down as their code executes. This article will start you off with a basic understanding of how Ruby objects relate to memory use, and we’ll cover a few common tricks to speed up your code while using less memory.