Flowdock

Notes posted by mechazoidal

RSS feed
December 3, 2009 - (>= v2.2.1)
1 thank

Capturing blocks after >2.2

After 2.2, you can omit the do …end block and simply use the &block variable directly:

concat(content_tag(:div, :class => "wrapped_content") do
  capture(&block)
end, block.binding)

becomes simply:

concat(content_tag(:div, capture(&block), :class => "wrapped_content"))