Sha256: 03fb152cd72cfe07c1a55b2f4f418b0e862c52b97e7842379a38fcc414209a02
Contents?: true
Size: 548 Bytes
Versions: 18
Compression:
Stored size: 548 Bytes
Contents
# frozen_string_literal: true module Input class FileComponent < ViewComponent::Base def initialize(item:, field:, form:, variant: nil) @item = item @field = field @form = form @label = label @variant = variant @picture = picture @object = object end def label I18n.t("bo.#{@item.class.name.downcase}.attributes.#{@field}") end def picture return object unless @variant object.variant(@variant) end def object @item.send(@field) end end end
Version data entries
18 entries across 18 versions & 1 rubygems