Sha256: 016b51bd9690508d95b95d575bc7e4b3494fabcf133e7e814e343548280edf62
Contents?: true
Size: 605 Bytes
Versions: 87
Compression:
Stored size: 605 Bytes
Contents
# frozen_string_literal: true class Avo::Fields::TrixField::EditComponent < Avo::Fields::EditComponent attr_reader :resource def initialize(**args) @resource = args[:resource] @resource_id = args[:resource_id] @resource_name = args[:resource_name] super(**args) end def resource_name @resource_name || resource&.singular_route_key end def resource_id @resource_id || resource&.record&.id end def trix_id if resource_name.present? "trix_#{resource_name}_#{@field.id}" elsif form.present? "trix_#{form.index}_#{@field.id}" end end end
Version data entries
87 entries across 87 versions & 1 rubygems