Sha256: 59a3edf083c7761755c5276c4232a0d94aed9bc8d0d8f47977315591fc779051

Contents?: true

Size: 673 Bytes

Versions: 5

Compression:

Stored size: 673 Bytes

Contents

module Trestle
  module PanelHelper
    def panel(options={}, &block)
      html_class = options.fetch(:class) { "panel-default" }

      content_tag(:div, class: ["panel", html_class]) do
        if options[:title]
          concat content_tag(:div, options[:title], class: "panel-heading")
        end

        concat content_tag(:div, class: "panel-body", &block)

        if options[:footer]
          concat content_tag(:div, options[:footer], class: "panel-footer")
        end
      end
    end

    def well(options={}, &block)
      html_class = ["well", options[:class]].compact
      content_tag(:div, options.merge(class: html_class), &block)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
trestle-0.8.11 app/helpers/trestle/panel_helper.rb
trestle-0.8.10 app/helpers/trestle/panel_helper.rb
trestle-0.8.9 app/helpers/trestle/panel_helper.rb
trestle-0.8.8 app/helpers/trestle/panel_helper.rb
trestle-0.8.7 app/helpers/trestle/panel_helper.rb