💎Ruby tip💎 Did you know that you can use the ampersand(&) operator with any method that require a block for some convenient shortcuts? Examples ⬇️ #ruby #rails #rubyonrails

websebdev's tweet image. 💎Ruby tip💎

Did you know that you can use the ampersand(&) operator with any method that
require a block for some convenient shortcuts?
Examples ⬇️

#ruby #rails #rubyonrails


In the work, we also use { _1.method }, that allows us to chain other methods if needed. Sometimes is more clear than (&: ) both work really well! Great tip!


United States Tendances
Loading...

Something went wrong.


Something went wrong.