Sha256: d09bd91388b70d9fad3c7341361a3dee97665d350474090b107a7df648b2fe4e

Contents?: true

Size: 634 Bytes

Versions: 57

Compression:

Stored size: 634 Bytes

Contents

# frozen_string_literal: true

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

  attr_reader :view

  def initialize(field: nil, resource: nil, index: 0, parent_model: nil)
    @field = field
    @resource = resource
    @index = index
    @parent_model = parent_model
    @view = :index
  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

57 entries across 57 versions & 1 rubygems

Version Path
avo-2.15.3 app/components/avo/fields/index_component.rb
avo-2.15.3.pre.1.data.attrs.to.sidebar.items app/components/avo/fields/index_component.rb
avo-2.15.2 app/components/avo/fields/index_component.rb
avo-2.15.2.pre.1 app/components/avo/fields/index_component.rb
avo-2.15.1 app/components/avo/fields/index_component.rb
avo-2.15.0 app/components/avo/fields/index_component.rb
avo-2.14.3.pre.7.polytranslations1 app/components/avo/fields/index_component.rb
avo-2.14.3.pre.6.nosprockets app/components/avo/fields/index_component.rb
avo-2.14.3.pre.5.nosprockets app/components/avo/fields/index_component.rb
avo-2.14.3.pre.4.tosqlfix app/components/avo/fields/index_component.rb
avo-2.14.3.pre.3.jsbundling app/components/avo/fields/index_component.rb
avo-2.14.3.pre.2.tailwindcss app/components/avo/fields/index_component.rb
avo-2.14.3.pre.1.branding app/components/avo/fields/index_component.rb
avo-2.14.2 app/components/avo/fields/index_component.rb
avo-2.14.2.pre.1 app/components/avo/fields/index_component.rb
avo-2.14.1 app/components/avo/fields/index_component.rb
avo-2.14.1.pre.1 app/components/avo/fields/index_component.rb
avo-2.14.0 app/components/avo/fields/index_component.rb
avo-2.13.6.pre.2 app/components/avo/fields/index_component.rb
avo-2.13.6.pre.1 app/components/avo/fields/index_component.rb