Sha256: 4b5fa340164592303a26e3f8b4ab47cb04959766ecf4bb06f4cbc191b129ed88
Contents?: true
Size: 444 Bytes
Versions: 1
Compression:
Stored size: 444 Bytes
Contents
class DefinitionComponent < ViewComponent::Base def initialize(label: nil, value: nil, obj: nil, fieldname: nil, options: {}) super @obj = obj @fieldname = fieldname @value = value || obj&.send(fieldname) @value = ApplicationController.helpers.format_value(@value, options) @value = '---' if @value.blank? @label = label || ApplicationController.helpers.label_for(obj, fieldname) @options = options end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
alveole-0.0.1 | lib/alveole/components/definition_component.rb |