class IRuby::Input::Label

Public Instance Methods

widget_label() { || ... } click to toggle source
# File lib/iruby/input/label.rb, line 6
def widget_label
  div class: 'iruby-label input-group' do 
    span class: 'input-group-addon' do 
      text @label || to_label(@key)
    end
    
    yield
    
    if @icon
      span @icon, class: "input-group-addon"
    end
  end
end

Private Instance Methods

to_label(label) click to toggle source
# File lib/iruby/input/label.rb, line 22
def to_label label
  label.to_s.tr('_',' ').capitalize
end