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.25.2 app/components/avo/fields/index_component.rb
avo-2.7.1.pre.1 app/components/avo/fields/index_component.rb
avo-2.7.0 app/components/avo/fields/index_component.rb
avo-2.6.1.pre.2 app/components/avo/fields/index_component.rb
avo-2.6.1.pre.1 app/components/avo/fields/index_component.rb
avo-2.6.0 app/components/avo/fields/index_component.rb
avo-2.5.2.pre.7 app/components/avo/fields/index_component.rb
avo-2.5.2.pre.6 app/components/avo/fields/index_component.rb
avo-2.5.2.pre.5 app/components/avo/fields/index_component.rb
avo-2.5.2.pre.4 app/components/avo/fields/index_component.rb
avo-2.5.2.pre.3 app/components/avo/fields/index_component.rb
avo-2.5.2.pre.2 app/components/avo/fields/index_component.rb
avo-2.5.2.pre.1 app/components/avo/fields/index_component.rb
avo-2.5.1 app/components/avo/fields/index_component.rb
avo-2.5.0 app/components/avo/fields/index_component.rb
avo-2.4.1 app/components/avo/fields/index_component.rb
avo-2.4.0 app/components/avo/fields/index_component.rb
avo-2.3.1.pre.6 app/components/avo/fields/index_component.rb
avo-2.3.1.pre.5 app/components/avo/fields/index_component.rb
avo-2.3.1.pre.4 app/components/avo/fields/index_component.rb