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/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 =
'2.0.0'.freeze
Instance Method Summary collapse
-
#accordion_group_helper(*args) {|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.
-
#host_is_dev_pc? ⇒ Boolean
Just a easy way of checking if the environment is a devbox or a server.
-
#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(args = {}) {|tabs| ... } ⇒ String
Used to rapidly build Tabs.
Instance Method Details
#accordion_group_helper(*args) {|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.
112 113 114 |
# File 'lib/bootstrap3_helper.rb', line 112 def accordion_group_helper(*args, &block) AccordionGroup.new(self, *args, &block) end |
#accordion_helper(*args) {|accordion| ... } ⇒ String
Easily build a bootstrap accordion component
132 133 134 |
# File 'lib/bootstrap3_helper.rb', line 132 def accordion_helper(*args, &block) Accordion.new(self, *args, &block) end |
#alert_helper(*args, &block) ⇒ String
Creates an Alert component.
52 53 54 |
# File 'lib/bootstrap3_helper.rb', line 52 def alert_helper(*args, &block) Alert.new(self, *args, &block) end |
#callout_helper(*args, &block) ⇒ String
Creates an Callout component.
67 68 69 |
# File 'lib/bootstrap3_helper.rb', line 67 def callout_helper(*args, &block) Callout.new(self, *args, &block) end |
#host_is_dev_pc? ⇒ Boolean
Just a easy way of checking if the environment is a devbox or a server.
76 77 78 |
# File 'lib/bootstrap3_helper.rb', line 76 def host_is_dev_pc? Rails.root.to_s.include?('home') end |
#icon_helper(name) ⇒ Object
Only supply the last part of the glyph makrup.
Allows you to rapidly build bootstrap glyphs.
145 146 147 |
# File 'lib/bootstrap3_helper.rb', line 145 def icon_helper(name) content_tag :span, '', class: "glyphicon glyphicon-#{name}" end |
#panel_helper(*args) {|panel| ... } ⇒ String
Allows you to rapidly build Panel components.
37 38 39 |
# File 'lib/bootstrap3_helper.rb', line 37 def panel_helper(*args, &block) Panel.new(self, *args, &block) end |
#tabs_helper(args = {}) {|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.
194 195 196 |
# File 'lib/bootstrap3_helper.rb', line 194 def tabs_helper(args = {}, &block) Tabs.new(self, args, &block) end |