Sha256: 901485b27a23ffe42fd734d09728d70d28d285d8993acbcdcb1729a08657e5a1
Contents?: true
Size: 519 Bytes
Versions: 18
Compression:
Stored size: 519 Bytes
Contents
module Compony module ModelFields class Color < Base def value_for(data, controller: nil, **_) return transform_and_join(data.send(@name), controller:) do |el| next nil unless el next controller.helpers.raw "#{el} <span style=\"background-color: #{el}\"> </span>" end end def simpleform_input(form, _component, name: nil, **input_opts) return form.input name || @name, as: :color, **input_opts end end end end
Version data entries
18 entries across 18 versions & 1 rubygems