Sha256: 2388a9961ca75eb06cbf742579f25aaaaac6f70c15a22d06ca34c0c4a164851f

Contents?: true

Size: 1.19 KB

Versions: 34

Compression:

Stored size: 1.19 KB

Contents

module BootstrapBuilders::ApplicationHelper
  include BootstrapBuilders::ButtonsHelper

  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

  def bb_attribute_rows(model, attributes)
    BootstrapBuilders::AttributeRows.new(model: model, attributes: attributes, context: self).html
  end

  def bb_panel(*opts, &blk)
    panel = BootstrapBuilders::Panel.with_parsed_args(*opts, &blk)
    panel.context = self
    panel.html
  end

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

  def bb_flash(args = {})
    flash = BootstrapBuilders::Flash.new(args.merge(context: self))
    flash.html
  end

  def bb_table(args = {}, &blk)
    table = BootstrapBuilders::Table.new(args.merge(context: self, blk: blk))
    table.html
  end

  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
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
bootstrap_builders-1.0.4 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.63 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-1.0.3 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-1.0.2 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-1.0.1 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-1.0.0 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.62 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.61 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.60 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.59 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.58 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.57 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.56 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.55 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.54 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.53 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.52 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.51 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.50 app/helpers/bootstrap_builders/application_helper.rb
bootstrap_builders-0.0.49 app/helpers/bootstrap_builders/application_helper.rb