Sha256: 60949c9af0292bf5589fe13c2ff6c1929368068a5e976c5bb0f73c6aecf2d691

Contents?: true

Size: 538 Bytes

Versions: 69

Compression:

Stored size: 538 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(@resource.model, via_resource_class: @parent_model.class, via_resource_id: @parent_model.id)
    else
      helpers.resource_path(@resource.model)
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
avo-1.18.2 app/components/avo/fields/index_component.rb
avo-1.18.2.pre.0 app/components/avo/fields/index_component.rb
avo-1.18.1 app/components/avo/fields/index_component.rb
avo-1.18.0 app/components/avo/fields/index_component.rb
avo-1.18.0.pre.3 app/components/avo/fields/index_component.rb
avo-1.18.0.pre.2 app/components/avo/fields/index_component.rb
avo-1.18.0.pre.1 app/components/avo/fields/index_component.rb
avo-1.17.1 app/components/avo/fields/index_component.rb
avo-1.17.0 app/components/avo/fields/index_component.rb
avo-1.16.4 app/components/avo/fields/index_component.rb
avo-1.16.3 app/components/avo/fields/index_component.rb
avo-1.16.2 app/components/avo/fields/index_component.rb
avo-1.16.1 app/components/avo/fields/index_component.rb
avo-1.16.0 app/components/avo/fields/index_component.rb
avo-1.15.0 app/components/avo/fields/index_component.rb
avo-1.15.0.pre.1 app/components/avo/fields/index_component.rb
avo-1.14.0 app/components/avo/fields/index_component.rb
avo-1.13.3 app/components/avo/fields/index_component.rb
avo-1.13.2 app/components/avo/fields/index_component.rb
avo-1.13.1 app/components/avo/fields/index_component.rb