Sha256: 223a8b24819ae8e4e50bd2a374463ebdbb6360bf468a73354caaaf688e7a26c4

Contents?: true

Size: 684 Bytes

Versions: 10

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

module BootstrapLeather
  # Widgets (my term, not bootstrap's), such as a right sidebar with separate
  # sections
  module WidgetsHelper
    def add_widget(html_options = {}, &block)
      @widgets ||= []
      @widgets << { html_options: html_options, body: capture(&block) }
    end

    def widgets
      mine = @widgets
      @widgets = nil
      mine
    end

    def render_widgets(device_class = 'md', column_width = 3)
      render(
        partial: 'bootstrap_leather/widgets/widgets',
        locals: {
          widgets: widgets,
          column_width: column_width,
          device_class: device_class
        }
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bootstrap_leather-0.10.14 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.13 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.11 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.10 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.9 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.8 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.7 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.6 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.5 app/helpers/bootstrap_leather/widgets_helper.rb
bootstrap_leather-0.10.4 app/helpers/bootstrap_leather/widgets_helper.rb