Sha256: 6e50f8a3b68e5a320ebeecc7e881772b7970ca5d1f97ff5613625ce16567d4be

Contents?: true

Size: 964 Bytes

Versions: 1

Compression:

Stored size: 964 Bytes

Contents

require "action_view"
require "action_controller"
require "call_with_params"

module Blocks
  autoload :Base,          "blocks/base"
  autoload :Container,     "blocks/container"
  autoload :ViewAdditions, "blocks/view_additions"
  autoload :ControllerAdditions, "blocks/controller_additions"

  mattr_accessor :template_folder
  @@template_folder = "blocks"

  mattr_accessor :use_partials
  @@use_partials = false

  mattr_accessor :wrap_with_surrounds_before_and_after_blocks
  @@wrap_with_surrounds_before_and_after_blocks = false

  # Shortcut for using the templating feature / rendering templates
  def self.render_template(view, partial, options={}, &block)
    Blocks::Base.new(view, options).render_template(partial, &block)
  end

  # Default way to setup Blocks
  def self.setup
    yield self
  end
end

ActionView::Base.send :include, Blocks::ViewAdditions::ClassMethods
ActionController::Base.send :include, Blocks::ControllerAdditions::ClassMethods

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blocks-2.5.0 lib/blocks.rb