Module: BootstrapLabelHelper

Defined in:
app/helpers/bootstrap_label_helper.rb

Overview

RAILS BOOTSTRAP ENGINE

Bootstrap Labels twitter.github.com/bootstrap/components.html#labels-badges

Copyright 2012-2013 Luiz Eduardo de Oliveira Fonseca, Agência Orangeweb

Licensed under The MIT License

opensource.org/licenses/MIT

Instance Method Summary collapse

Instance Method Details

#bootstrap_label(value, type = :default) ⇒ Object

Generates base label markup

<span class=“label label-?”>Text</span>



25
26
27
# File 'app/helpers/bootstrap_label_helper.rb', line 25

def bootstrap_label(value, type = :default)
	raw( :span, value, :class => "label label-#{type.to_s}")
end

#label_default(value) ⇒ Object

Generates default label markup

<span class=“label”>Text</span>



37
38
39
# File 'app/helpers/bootstrap_label_helper.rb', line 37

def label_default value
	bootstrap_label value, :default    
end

#label_important(value) ⇒ Object

Generates default label markup

<span class=“label label-important”>Text</span>



73
74
75
# File 'app/helpers/bootstrap_label_helper.rb', line 73

def label_important value
	bootstrap_label value, :important 
end

#label_info(value) ⇒ Object

Generates default label markup

<span class=“label label-info”>Text</span>



85
86
87
# File 'app/helpers/bootstrap_label_helper.rb', line 85

def label_info value
	bootstrap_label value, :info
end

#label_inverse(value) ⇒ Object

Generates default label markup

<span class=“label label-inverse”>Text</span>



97
98
99
# File 'app/helpers/bootstrap_label_helper.rb', line 97

def label_inverse value
	bootstrap_label value, :inverse
end

#label_success(value) ⇒ Object

Generates default label markup

<span class=“label label-success”>Text</span>



49
50
51
# File 'app/helpers/bootstrap_label_helper.rb', line 49

def label_success value
	bootstrap_label value, :success   
end

#label_warning(value) ⇒ Object

Generates default label markup

<span class=“label label-warning”>Text</span>



61
62
63
# File 'app/helpers/bootstrap_label_helper.rb', line 61

def label_warning value
	bootstrap_label value, :warning   
end

#yes_no_label(val, yes_text = "Sim", no_text = "Não") ⇒ Object

Exibe o texto ‘Sim’ ou ‘Não’ para um valor booleano em um Label



106
107
108
109
110
111
112
# File 'app/helpers/bootstrap_label_helper.rb', line 106

def yes_no_label(val, yes_text = "Sim", no_text = "Não")
  	if val then
  		label_success yes_text
  	else
  		label_default no_text
  	end
end