Module: BootstrapLeather::WidgetsHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/bootstrap_leather/widgets_helper.rb
Overview
Widgets (my term, not bootstrap’s), such as a right sidebar with separate sections
Instance Method Summary collapse
- #add_widget(html_options = {}, &block) ⇒ Object
- #render_widgets(device_class = 'md', column_width = 3) ⇒ Object
- #widgets ⇒ Object
Instance Method Details
#add_widget(html_options = {}, &block) ⇒ Object
7 8 9 10 |
# File 'app/helpers/bootstrap_leather/widgets_helper.rb', line 7 def ( = {}, &block) @widgets ||= [] @widgets << { html_options: , body: capture(&block) } end |
#render_widgets(device_class = 'md', column_width = 3) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/bootstrap_leather/widgets_helper.rb', line 18 def (device_class = 'md', column_width = 3) render( partial: 'bootstrap_leather/widgets/widgets', locals: { widgets: , column_width: column_width, device_class: device_class } ) end |
#widgets ⇒ Object
12 13 14 15 16 |
# File 'app/helpers/bootstrap_leather/widgets_helper.rb', line 12 def mine = @widgets @widgets = nil mine end |