Use compact_blank to remove empty strings from Arrays and Hashes - Andy Croll
20-Sep-2021 1883
Active Support is a library of “useful” things that support (!) the other parts of Rails. It includes ways to extend the base Ruby classes, such as Hash, String and Integer.Even the most experienced Rails developer is constantly finding helpful methods in Active Support. And useful methods are continually being added in new versions of the library.We often have to clean up the values ofHashes and Arrays when parsing parameters, or if our code accepts complex input. Ruby provides the .
Use compact_blank to remove empty strings from Arrays and Hashes - Andy Croll #ruby #rubydeveloper #rubyonrails #compact_blank #remove #empty #strings #Arrays #Hashes #Croll #arrays https://rubyonrails.ba/link/use-compact_blank-to-remove-empty-strings-from-arrays-and-hashes-andy-croll