Explicit block arguments
Quick note on block argument syntax
I was passing in a
@data array of arrays from the controller and accessing the contents per item like so.
@data.each do |item| puts item puts item puts item end
BUT!!!!! I can be more descriptive by labelling out these items explicitly in the args, making sure to add parenthesis
() and a labels.
@data.each do |(name, age, spending)| puts name puts age puts spending end
So much more understandable