Sha256: 3bd8322319658db1bc37b2dbce0c307308883bcebbe517b77b6a1db9464cb559
Contents?: true
Size: 508 Bytes
Versions: 9
Compression:
Stored size: 508 Bytes
Contents
module Trestle class Tab include ActionView::Helpers::TagHelper attr_reader :name, :options def initialize(name, options={}) @name, @options = name, options end def id(tag=nil) ["tab", tag, name].compact.join("-") end def label safe_join([options[:label] || I18n.t("admin.tabs.#{name}", default: name.to_s.titleize), badge].compact, " ") end def badge content_tag(:span, options[:badge], class: "badge") if options[:badge] end end end
Version data entries
9 entries across 9 versions & 1 rubygems