class Trestle::Tab
Attributes
name[R]
options[R]
Public Class Methods
new(name, options={})
click to toggle source
# File lib/trestle/tab.rb, line 9 def initialize(name, options={}) @name, @options = name, options end
Public Instance Methods
badge()
click to toggle source
# File lib/trestle/tab.rb, line 21 def badge content_tag(:span, options[:badge], class: "badge") if options[:badge] end
id(tag=nil)
click to toggle source
# File lib/trestle/tab.rb, line 13 def id(tag=nil) ["tab", tag, name].compact.join("-") end
label()
click to toggle source
# File lib/trestle/tab.rb, line 17 def label safe_join([options[:label] || I18n.t("admin.tabs.#{name}", default: name.to_s.titleize), badge].compact, " ") end