Sha256: 8938065e5fd977ad68b41381fb453d474b12c206fe17f16da3b92d4e4a1b3d6c

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

module Avo
  module ResourcesHelper
    def resource_table(resources, resource)
      render partial: "avo/partials/resource_table", locals: {
        resources: resources,
        resource: resource
      }
    end

    def resource_grid(resources, resource)
      render partial: "avo/partials/resource_grid", locals: {
        resources: resources,
        resource: resource
      }
    end

    def index_field_wrapper(**args, &block)
      render Index::FieldWrapperComponent.new(**args) do
        capture(&block)
      end
    end

    def field_wrapper(**args, &block)
      render Avo::FieldWrapperComponent.new(**args) do
        capture(&block)
      end
    end
    alias_method :edit_field_wrapper, :field_wrapper
    alias_method :show_field_wrapper, :field_wrapper

    def filter_wrapper(name: nil, index: nil, **args, &block)
      render layout: "layouts/avo/filter_wrapper", locals: {
        name: name,
        index: index
      } do
        capture(&block)
      end
    end

    def item_selector_data_attributes(resource)
      {
        resource_name: resource.model_key,
        resource_id: resource.record.to_param,
        controller: "item-selector"
      }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
avo-3.9.2 app/helpers/avo/resources_helper.rb
avo-3.9.1 app/helpers/avo/resources_helper.rb
avo-3.8.2 app/helpers/avo/resources_helper.rb
avo-3.9.0 app/helpers/avo/resources_helper.rb
avo-3.8.1 app/helpers/avo/resources_helper.rb
avo-3.8.0 app/helpers/avo/resources_helper.rb