Sha256: f9ae2b2daa04e9ac0354d4e78cd284d8fb5686addc90c0206d5d9105a4a35db5
Contents?: true
Size: 804 Bytes
Versions: 5
Compression:
Stored size: 804 Bytes
Contents
module OperatingsystemsHelper include CommonParametersHelper def icon record, opts = {} return "" if record.blank? or record.name.blank? family = case record.name when /fedora/i "Fedora" when /ubuntu/i "Ubuntu" when /solaris|sunos/i "Solaris" when /darwin/i "Darwin" when /centos/i "Centos" when /scientific/i "Scientific" when /archlinux/i "Archlinux" when /SLC/i "SLC" else return "" if record.family.blank? record.family end image_tag(family+".png", opts) + " " end def os_name record, opts = {} "#{icon(record, opts)} #{record}".html_safe end def os_habtm_family type, obj result = type.where(:os_family => obj.family) result.empty? ? type : result end end
Version data entries
5 entries across 5 versions & 1 rubygems