Module: BootstrapBuilders::ApplicationHelper

Includes:
ButtonsHelper
Defined in:
app/helpers/bootstrap_builders/application_helper.rb

Instance Method Summary collapse

Methods included from ButtonsHelper

#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)
   :tr do
    parts = []
    parts << (:th, title)
    parts << (: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



23
24
25
# File 'app/helpers/bootstrap_builders/application_helper.rb', line 23

def bb_progress_bar(*opts)
  BootstrapBuilders::ProgressBar.with_parsed_args(*opts)
end

#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

Yields:

  • (tabs)


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