module Blocks
Complete hack to get around issues with Haml
Haml does some hacking to ActionView's with_output_buffer and output_buffer. In doing so, they make certain assumptions about the layout and the view template. (See: https://github.com/haml/haml/blob/master/lib/haml/helpers/action_view_mods.rb#L11, and https://github.com/haml/haml/blob/master/lib/haml/helpers.rb#L389) The Blocks gem doesn't capture blocks immediately but rather stores them for later capturing. This can produce an issue if a block that is stored was defined in Haml but the Layout is in ERB. Haml will think that any blocks it captures while rendering the layout will be in ERB format. However, the block would need to be captured in Haml using a Haml buffer. This workaround accomplishes that.
Constants
- VERSION