Sha256: 0105154ba357aaa7a1434ef212eae9b2f23c9f4996273d160efcaa39f0a0b8d1
Contents?: true
Size: 513 Bytes
Versions: 22
Compression:
Stored size: 513 Bytes
Contents
class ActiveAdmin::Views::AttributesTable def status_tag_row(name, texts, states) value = @record.send(name) row name, :class => [name.to_s.gsub(/\?$/, ''), value ? 'yes' : 'no'] * ' ' do text = value ? texts.first : texts.last state = value ? states.first : states.last if state status_tag text, state else text end end end def boolean_status_tag_row(name, yes_state = :warning) status_tag_row(name, ['Ja', '-'], [yes_state, nil]) end end
Version data entries
22 entries across 22 versions & 1 rubygems