module BootstrapNavbar::Helpers::Bootstrap3
Public Instance Methods
Private Instance Methods
brand_link(name, url = nil)
click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap3.rb, line 155 def brand_link(name, url = nil) url ||= '/' prepare_html <<-HTML.chomp! <a href="#{url}" class="navbar-brand"> #{name} </a> HTML end
container(type, &block)
click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap3.rb, line 144 def container(type, &block) css_class = 'container' css_class << "-#{type}" if type.is_a?(String) attributes = attributes_for_tag(class: css_class) prepare_html <<-HTML.chomp! <div#{attributes}> #{capture(&block) if block_given?} </div> HTML end
wrapper(options, &block)
click to toggle source
# File lib/bootstrap-navbar/helpers/bootstrap3.rb, line 164 def wrapper(options, &block) options = options.dup options[:class] = [options[:class], 'navbar'].compact options[:class] << "navbar-#{options.delete(:inverse) ? 'inverse' : 'default'}" options[:class] << "navbar-fixed-#{options.delete(:fixed)}" if options.key?(:fixed) options[:class] << 'navbar-static-top' if options.delete(:static) options[:class] = options[:class].join(' ') options[:role] ||= 'navigation' attributes = attributes_for_tag(options) prepare_html <<-HTML.chomp! <nav#{attributes}> #{capture(&block) if block_given?} </nav> HTML end