I just read about the Rails' method concatfor clearing helpers that output something here http://thepugautomatic.com/2013/06/helpers/ .
I played with it, and I found that it does not react the same way it locks curly braces and blocks with do ... end.
def output_something
concat content_tag :strong { "hello" }
concat content_tag :strong do "hello" end
concat(content_tag :strong do "hello" end)
end
I did not know that curly braces and ... end blocks seem to have different meanings. Is there a way to use concatwith do ... end without putting brackets around it (third example)? Otherwise, apparently, it is rather useless for certain situations, for example. when I want to concatenate UL with many LI elements in it, so I need to use a few lines of code.
source
share