Module: Blocks
- Extended by:
- ActiveSupport::Autoload
- Includes:
- Configurator
- Defined in:
- lib/blocks/helpers/haml_capture.rb,
lib/blocks.rb,
lib/blocks/engine.rb,
lib/blocks/version.rb,
lib/blocks/builders/builder.rb,
lib/blocks/renderers/renderer.rb,
lib/blocks/utilities/options_set.rb,
lib/blocks/utilities/configurator.rb,
lib/blocks/helpers/view_extensions.rb,
lib/blocks/builders/hook_definition.rb,
lib/blocks/renderers/block_renderer.rb,
lib/blocks/builders/block_definition.rb,
lib/blocks/renderers/runtime_context.rb,
lib/blocks/renderers/partial_renderer.rb,
lib/blocks/renderers/wrapper_renderer.rb,
lib/blocks/utilities/hash_with_caller.rb,
lib/blocks/renderers/block_placeholder.rb,
lib/blocks/helpers/controller_extensions.rb,
lib/blocks/renderers/collection_renderer.rb,
lib/blocks/renderers/nesting_blocks_renderer.rb,
lib/blocks/renderers/adjacent_blocks_renderer.rb,
lib/blocks/renderers/block_with_hooks_renderer.rb,
lib/blocks/utilities/hash_with_render_strategy.rb
Overview
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.
Defined Under Namespace
Modules: Configurator, ControllerExtensions, HamlCapture, HashWithCaller, ViewExtensions Classes: AdjacentBlocksRenderer, BlockDefinition, BlockPlaceholder, BlockRenderer, BlockWithHooksRenderer, Builder, CollectionRenderer, HashWithRenderStrategy, HookDefinition, NestingBlocksRenderer, OptionsSet, PartialRenderer, Railtie, Renderer, RuntimeContext, WrapperRenderer
Constant Summary collapse
- VERSION =
"4.0.1"