Module: BigBand::MoreHelpers::InstanceMethods

Includes:
Haml::Helpers
Defined in:
lib/big_band/more_helpers.rb

Instance Method Summary collapse

Instance Method Details

#content_for(name, &block) ⇒ Object



12
13
14
15
16
17
# File 'lib/big_band/more_helpers.rb', line 12

def content_for(name, &block)
  name = name.to_s
  @content_for ||= Hash.new {|h,k| h[k] = [] }
  @content_for[name] << block if block
  @content_for[name]
end

#get_content(name, *args) ⇒ Object



28
29
30
# File 'lib/big_band/more_helpers.rb', line 28

def get_content(name, *args)
  non_haml { yield_content(name, *args) }
end

#yield_content(name, *args) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/big_band/more_helpers.rb', line 19

def yield_content(name, *args)
  haml_helper do
    content_for(name).each do |block|
      result = block.call(*args)
      haml_concat result unless block_is_haml? block
    end
  end
end