Module: Bootstrap3Helper
- Defined in:
- lib/bootstrap3_helper.rb,
lib/bootstrap3_helper/tabs.rb,
lib/bootstrap3_helper/alert.rb,
lib/bootstrap3_helper/panel.rb,
lib/bootstrap3_helper/callout.rb,
lib/bootstrap3_helper/railtie.rb,
lib/bootstrap3_helper/version.rb,
lib/bootstrap3_helper/accordion.rb,
lib/bootstrap3_helper/component.rb,
lib/bootstrap3_helper/tabs/menu.rb,
lib/bootstrap3_helper/initialize.rb,
lib/bootstrap3_helper/tabs/content.rb,
lib/bootstrap3_helper/configuration.rb,
lib/bootstrap3_helper/tabs/dropdown.rb,
lib/bootstrap3_helper/accordion_group.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Accordion, AccordionGroup, Alert, Callout, Component, Configuration, Panel, Railtie, Tabs
Constant Summary collapse
- VERSION =
'3.0.1'.freeze
Class Method Summary collapse
-
.config {|@_bs3h_config| ... } ⇒ Bootstrap5Helper::Configuration
Simple interface for exposing the configuration object.
Instance Method Summary collapse
-
#accordion_group_helper(opts = {}) {|group| ... } ⇒ String
Easily build a bootstrap accordion group component.
-
#accordion_helper(*args) {|accordion| ... } ⇒ String
Easily build a bootstrap accordion component.
-
#alert_helper(*args, &block) ⇒ String
Creates an Alert component.
-
#callout_helper(*args, &block) ⇒ String
Creates an Callout component.
-
#icon_helper(name) ⇒ Object
Allows you to rapidly build bootstrap glyphs.
-
#panel_helper(*args) {|panel| ... } ⇒ String
Allows you to rapidly build Panel components.
-
#tabs_helper(opts = {}) {|tabs| ... } ⇒ String
Used to rapidly build Tabs.
Class Method Details
.config {|@_bs3h_config| ... } ⇒ Bootstrap5Helper::Configuration
Simple interface for exposing the configuration object.
13 14 15 16 17 |
# File 'lib/bootstrap3_helper/initialize.rb', line 13 def config yield @_bs3h_config if block_given? @_bs3h_config end |
Instance Method Details
#accordion_group_helper(opts = {}) {|group| ... } ⇒ String
All the element ids and data attributes needed to make the javascript function, are all synced up in the AccordionGroup and Accordion classes. You don’t need to worry about them.
Easily build a bootstrap accordion group component.
58 59 60 |
# File 'lib/bootstrap3_helper.rb', line 58 def accordion_group_helper(opts = {}, &block) AccordionGroup.new(self, opts, &block) end |
#accordion_helper(context, opts) ⇒ String #accordion_helper(opts) ⇒ String
Easily build a bootstrap accordion component
90 91 92 |
# File 'lib/bootstrap3_helper.rb', line 90 def accordion_helper(*args, &block) Accordion.new(self, *args, &block) end |
#alert_helper(context, opts) ⇒ String #alert_helper(opts) ⇒ String
Creates an Alert component.
117 118 119 |
# File 'lib/bootstrap3_helper.rb', line 117 def alert_helper(*args, &block) Alert.new(self, *args, &block) end |
#callout_helper(context, opts) ⇒ String #callout_helper(opts) ⇒ String
Creates an Callout component.
143 144 145 |
# File 'lib/bootstrap3_helper.rb', line 143 def callout_helper(*args, &block) Callout.new(self, *args, &block) end |
#icon_helper(name) ⇒ Object
Only supply the last part of the glyph makrup.
Allows you to rapidly build bootstrap glyphs.
156 157 158 |
# File 'lib/bootstrap3_helper.rb', line 156 def icon_helper(name) content_tag :span, '', class: "glyphicon glyphicon-#{name}" end |
#panel_helper(context, opts) ⇒ String #panel_helper(opts) ⇒ String
Allows you to rapidly build Panel components.
192 193 194 |
# File 'lib/bootstrap3_helper.rb', line 192 def panel_helper(*args, &block) Panel.new(self, *args, &block) end |
#tabs_helper(opts = {}) {|tabs| ... } ⇒ String
On menu items - you can pass in either symbol or string for the link. If you pass in a block, it will use the block for the title of the li. If no block is present, then it will titleize the symbol or string. Tabs::Menu will respond to item
and dropdown
Each method will yield the corresponding component, either a Tabs::Menu or a Tabs::Dropdown.
Used to rapidly build Tabs.
247 248 249 |
# File 'lib/bootstrap3_helper.rb', line 247 def tabs_helper(opts = {}, &block) Tabs.new(self, opts, &block) end |