Sha256: 82f65eb04f663e040346f7c24e8aee7694433cb71d03e188a048445cfcd80f21
Contents?: true
Size: 545 Bytes
Versions: 25
Compression:
Stored size: 545 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("#{@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
25 entries across 25 versions & 2 rubygems