Module: Activist::BlockHelpers
- Defined in:
- lib/activist/block_helpers.rb
Instance Method Summary collapse
- #notice_block(title, &block) ⇒ Object
-
#section_block(title, options = {}) {|builder| ... } ⇒ Object
:block_class : a class applied to the outermost div.
- #sidebar_block(title, &block) ⇒ Object
Instance Method Details
#notice_block(title, &block) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/activist/block_helpers.rb', line 4 def notice_block(title, &block) content = capture(&block) content_for(:sidebar) do content_tag(:div, :class => [:block, :notice]) do content_tag(:h4, title) + content_tag(:p, content) end end end |
#section_block(title, options = {}) {|builder| ... } ⇒ Object
:block_class : a class applied to the outermost div
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/activist/block_helpers.rb', line 14 def section_block(title, = {}) builder = Builder.new(self) yield builder content_tag(:div, content_tag(:div, content_tag(:div, builder.control, :class => :control) + content_tag(:h2, title, :class => :title) + content_tag(:div, builder.content, :class => :inner), :class => :content), :class => [:block, [:block_class]]) end |
#sidebar_block(title, &block) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/activist/block_helpers.rb', line 26 def (title, &block) content = capture(&block) content_for(:sidebar) do content_tag(:div, :class => ['sidebar-block']) do content_tag(:h4, title) + content_tag(:p, content) end end end |