# File lib/tw_bootstrap_helper/view_helper.rb, line 39 def primary_link_to title, path, options={} bootstrap_link_to title, path, :primary, options end
module TwBootStrapHelper::ViewHelper
Extende os Helpers da Aplicação
Public Instance Methods
bootstrap_label(title, type, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 95 def bootstrap_label title, type, options={} options[:class] = "" unless options.has_key?(:class) options[:class].insert(0, " label " + type.to_s) raw content_tag :span, " #{title} ", options end
bootstrap_link_to(title, path, type, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 15 def bootstrap_link_to title, path, type, options={} options[:class] = "" unless options.has_key?(:class) options[:class].insert(0, " btn " + type.to_s) if options.has_key?(:small) then if options[:small] == true then options[:class].insert(-1, " small ") end options.delete(:small) end options[:class].to_s.strip! link_to title, path, options end
cancel_link_to(title, path, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 68 def cancel_link_to title, path, options={} default_link_to title, path, options end
danger_link_to(title, path, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 54 def danger_link_to title, path, options={} bootstrap_link_to title, path, :danger, options end
default_link_to(title, path, options={})
click to toggle source
Default Options from Links with Bootstraper
# File lib/tw_bootstrap_helper/view_helper.rb, line 34 def default_link_to title, path, options={} bootstrap_link_to title, path, :default, options end
delete_link_to(title, path, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 76 def delete_link_to title, path, options={} options[:confirm] = 'Tem certeza que deseja apagar este item?' options[:method] = :delete danger_link_to title, path, options end
edit_link_to(title, path, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 72 def edit_link_to title, path, options={} info_link_to title, path, options end
grid_col(cols, center=true,&block)
click to toggle source
Bootstrap Col Grid
# File lib/tw_bootstrap_helper/view_helper.rb, line 154 def grid_col(cols, center=true,&block) content = capture(&block) cl = "span#{cols}" content_tag(:div, content, :class => cl) end
grid_row(&block)
click to toggle source
Bootstrap Row Grid
# File lib/tw_bootstrap_helper/view_helper.rb, line 147 def grid_row(&block) content = capture(&block) raw content_tag(:div, content, :class => "grid row") end
info_link_to(title, path, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 44 def info_link_to title, path, options={} bootstrap_link_to title, path, :info, options end
label_back(title="<< Voltar")
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 139 def label_back title="<< Voltar" label_default title end
label_default(title, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 101 def label_default title, options={} bootstrap_label title, :default, options={} end
label_details(title="+ Detalhes")
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 135 def label_details title="+ Detalhes" label_notice title end
label_error(title="Erro")
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 127 def label_error title="Erro" label_important title end
label_important(title, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 113 def label_important title, options={} bootstrap_label title, :important, options={} end
label_incomplete(title="Incompleto")
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 131 def label_incomplete title="Incompleto" label_warning title end
label_new(title="Novo")
click to toggle source
Commom Alias from Labels
# File lib/tw_bootstrap_helper/view_helper.rb, line 123 def label_new title="Novo" label_success title end
label_notice(title, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 117 def label_notice title, options={} bootstrap_label title, :notice, options={} end
label_success(title, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 105 def label_success title, options={} bootstrap_label title, :success, options={} end
label_warning(title, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 109 def label_warning title, options={} bootstrap_label title, :warning, options={} end
lorem_ipsum()
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 214 def lorem_ipsum <<-eos Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris fermentum tempor arcu in mollis. Aliquam erat volutpat. Sed malesuada lacinia nibh, eget posuere turpis accumsan vitae. Aliquam lacus massa, pellentesque auctor volutpat eu, luctus ac enim. Nullam venenatis tellus nec tortor dictum rutrum. Proin sed magna eu mauris posuere vulputate vel quis nunc. Donec at elit sapien, vitae mattis arcu. Maecenas sollicitudin auctor volutpat. Vivamus tincidunt interdum placerat. In mattis, metus vel pellentesque accumsan, neque nisi ornare lectus, et interdum lectus ipsum sed augue. Nullam sollicitudin placerat enim a lobortis. Curabitur id lorem turpis, sit amet euismod elit. eos end
new_link_to(title, path, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 64 def new_link_to title, path, options={} success_link_to title, path, options end
pill(&block)
click to toggle source
Show a Pill Toolbar
# File lib/tw_bootstrap_helper/view_helper.rb, line 83 def pill(&block) content = capture(&block) content_tag(:div, content_tag(:ul, content, :class => "pills")) end
pill_item(&block)
click to toggle source
Show a Pill Toolbar Item
# File lib/tw_bootstrap_helper/view_helper.rb, line 89 def pill_item(&block) content = capture(&block) content_tag(:li, content) end
pill_link_to(title, path, options={})
click to toggle source
Commom Alias from Links
# File lib/tw_bootstrap_helper/view_helper.rb, line 60 def pill_link_to title, path, options={} link_to title, path, options end
primary_link_to(title, path, options={})
click to toggle source
success_link_to(title, path, options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 49 def success_link_to title, path, options={} bootstrap_link_to title, path, :success, options end
table(opts={}, &block)
click to toggle source
table_body(&block)
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 194 def table_body(&block) content = capture(&block) content_tag(:tbody, content) end
table_head(&block)
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 178 def table_head(&block) content = capture(&block) content_tag(:thead, content_tag(:tr, content)) end
table_td(value="", options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 210 def table_td(value="", options={}) content_tag(:td, value, options) end
table_td_block(options={}, &block)
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 205 def table_td_block(options={}, &block) content = capture(&block) content_tag(:td, content, options) end
table_th(value="", options={})
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 189 def table_th(value="", options={}) content_tag(:th, value) end
table_th_block(options={}, &block)
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 184 def table_th_block(options={}, &block) content = capture(&block) content_tag(:th, content) end
table_tr(&block)
click to toggle source
# File lib/tw_bootstrap_helper/view_helper.rb, line 200 def table_tr(&block) content = capture(&block) content_tag(:tr, content) end