Module: Blocks

Defined in:
lib/blocks.rb,
lib/blocks/base.rb,
lib/blocks/container.rb,
lib/blocks/proc_with_args.rb,
lib/blocks/view_additions.rb,
lib/blocks/controller_additions.rb

Defined Under Namespace

Modules: ControllerAdditions, ViewAdditions Classes: Base, Container, ProcWithArgs

Constant Summary collapse

@@template_folder =
"blocks"
@@use_partials =
false
@@surrounding_tag_surrounds_before_and_after_blocks =
false

Class Method Summary collapse

Class Method Details

.render_template(view, partial, options = {}, &block) ⇒ Object

Shortcut for using the templating feature / rendering templates



21
22
23
# File 'lib/blocks.rb', line 21

def self.render_template(view, partial, options={}, &block)
  Blocks::Base.new(view, options).render_template(partial, &block)
end

.setup {|_self| ... } ⇒ Object

Default way to setup Blocks

Yields:

  • (_self)

Yield Parameters:

  • _self (Blocks)

    the object that the method was called on



26
27
28
# File 'lib/blocks.rb', line 26

def self.setup
  yield self
end