module Blocks::ViewExtensions

Public Instance Methods

blocks() click to toggle source
# File lib/blocks/helpers/view_extensions.rb, line 7
def blocks
  @blocks ||= Blocks.builder_class.new(self)
end
render_with_overrides(*args, &block) click to toggle source
# File lib/blocks/helpers/view_extensions.rb, line 11
def render_with_overrides(*args, &block)
  options = args.extract_options!
  partial = options.delete(:partial) || options.delete(:template) || args.first
  if builder = options.delete(:builder)
    builder.view = self
    # builder = builder.clone
    # TODO: figure out what to do here
  else
    # TODO: options shouldn't have to be passed both here and to the render call below - need it to be just one place
    builder = Blocks.builder_class.new(self, options)
  end
  builder.render(options.merge(partial: partial), &block)
end
with_template(*args, &block) click to toggle source

DEPRECATED: Please use render_with_overrides instead.

# File lib/blocks/helpers/view_extensions.rb, line 26
def with_template(*args, &block)
  warn "[DEPRECATION] `with_template` is deprecated.  Please use `render_with_overrides` instead."
  render_with_overrides(*args, &block)
end