Module: BootstrapBuilders::ApplicationHelper
- Includes:
- ButtonsHelper
- Defined in:
- app/helpers/bootstrap_builders/application_helper.rb
Instance Method Summary
collapse
#bb_btn, #bb_btn_drop_down, #bb_destroy_btn, #bb_edit_btn, #bb_index_btn, #bb_new_btn, #bb_show_btn
Instance Method Details
#bb_attribute_row(title, value) ⇒ Object
4
5
6
7
8
9
10
11
|
# File 'app/helpers/bootstrap_builders/application_helper.rb', line 4
def bb_attribute_row(title, value)
content_tag :tr do
parts = []
parts << content_tag(:th, title)
parts << content_tag(:td, value)
safe_join parts
end
end
|
#bb_attribute_rows(model, attributes) ⇒ Object
13
14
15
|
# File 'app/helpers/bootstrap_builders/application_helper.rb', line 13
def bb_attribute_rows(model, attributes)
BootstrapBuilders::AttributeRows.new(model: model, attributes: attributes, context: self).html
end
|
#bb_flash(args = {}) ⇒ Object
27
28
29
30
|
# File 'app/helpers/bootstrap_builders/application_helper.rb', line 27
def bb_flash(args = {})
flash = BootstrapBuilders::Flash.new(args.merge(context: self))
flash.html
end
|
#bb_panel(*opts, &blk) ⇒ Object
17
18
19
20
21
|
# File 'app/helpers/bootstrap_builders/application_helper.rb', line 17
def bb_panel(*opts, &blk)
panel = BootstrapBuilders::Panel.with_parsed_args(*opts, &blk)
panel.context = self
panel.html
end
|
#bb_progress_bar(*opts) ⇒ Object
#bb_table(args = {}, &blk) ⇒ Object
32
33
34
35
|
# File 'app/helpers/bootstrap_builders/application_helper.rb', line 32
def bb_table(args = {}, &blk)
table = BootstrapBuilders::Table.new(args.merge(context: self, blk: blk))
table.html
end
|
#bb_tabs(*args) {|tabs| ... } ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
|
# File 'app/helpers/bootstrap_builders/application_helper.rb', line 37
def bb_tabs(*args)
args = BootstrapBuilders::ArgumentsParser.new(
arguments: args,
argument_hash_default: {context: self},
short_true_arguments: [:justified, :pills, :stacked]
).arguments
tabs = BootstrapBuilders::Tabs.new(*args)
yield tabs
tabs.to_html
end
|