Sha256: 729e3e9ca7f2368542bf4ddfb77e85f943bcaa3ffd914b0536488788e9ae4f69

Contents?: true

Size: 676 Bytes

Versions: 10

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

module BootstrapLeather
  # Tabs, like the tabs of a folder
  module TabsHelper
    def add_tab(label, id, args = {}, &block)
      active = false
      if @tabs.nil?
        @tabs = []
        active = true
      end
      before_link = args[:before_link] ? args[:before_link] : ''
      @tabs << {
        id: id, label: label, active: active, before_link: before_link,
        content: capture(&block)
      }
    end

    def render_tabs(orientation = 'top')
      tabs = @tabs
      @tabs = nil
      render(
        partial: 'bootstrap_leather/tabs/tabs',
        locals: { tabs: tabs, orientation: orientation }
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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