words = self.tag.split words.each { |word| word = word.stem } self.tag = words.join(' ')
For this sentence, I want to perform an action stemfor each individual word .
stem
Is there any way to simplify this code?
self.tag = self.tag.split.map(&:stem).join(' ')
self.tag = self.tag.split.collect { |w| word.stem }.join(' ')
Not that I definitely recommend this.