Sha256: ca8d7c58c1f290ddaf375809e59fe428bc03fbc4f7bbcf3e041034590090f211

Contents?: true

Size: 594 Bytes

Versions: 64

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

class Avo::Fields::IndexComponent < ViewComponent::Base
  include Avo::ResourcesHelper

  def initialize(field: nil, resource: nil, index: 0, parent_model: nil)
    @field = field
    @resource = resource
    @index = index
    @parent_model = parent_model
  end

  def resource_path
    if @parent_model.present?
      helpers.resource_path(model: @resource.model, resource: @resource, via_resource_class: @parent_model.class, via_resource_id: @parent_model.id)
    else
      helpers.resource_path(model: @resource.model, resource: @resource)
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
avo-1.22.2 app/components/avo/fields/index_component.rb
avo-1.22.1 app/components/avo/fields/index_component.rb
avo-1.22.1.pre.2 app/components/avo/fields/index_component.rb
avo-1.22.1.pre.1 app/components/avo/fields/index_component.rb
avo-1.22.0 app/components/avo/fields/index_component.rb
avo-1.22.0.pre.1 app/components/avo/fields/index_component.rb
avo-1.21.1.pre.1 app/components/avo/fields/index_component.rb
avo-1.21.0 app/components/avo/fields/index_component.rb
avo-1.20.2.pre.2 app/components/avo/fields/index_component.rb
avo-1.20.2.pre.1 app/components/avo/fields/index_component.rb
avo-1.21.0.pre.1 app/components/avo/fields/index_component.rb
avo-1.20.1 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.11 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.10 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.9 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.8 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.7 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.6 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.5 app/components/avo/fields/index_component.rb
avo-1.19.1.pre.4 app/components/avo/fields/index_component.rb