Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_filters_for_all_fields dynamic filters helper #3550

Open
adrianthedev opened this issue Dec 20, 2024 · 2 comments
Open

add_filters_for_all_fields dynamic filters helper #3550

adrianthedev opened this issue Dec 20, 2024 · 2 comments

Comments

@adrianthedev
Copy link
Collaborator

Feature

Naming is TBD

We'd like to have a way to add all the possible dynamic filters for all index fields.

Current workarounds

Screenshots or screen recordings

Additional context

@Paul-Bob
Copy link
Contributor

Paul-Bob commented Dec 21, 2024

# == Schema Information
#
# Table name: courses
#
#  id          :bigint           not null, primary key
#  name        :string
#  created_at  :datetime         not null
#  updated_at  :datetime         not null
#  skills      :text             default([]), is an Array
#  country     :string
#  city        :string
#  starting_at :time
#
class Course < ApplicationRecord
  # ...
end

class Avo::Resources::Course < Avo::BaseResource
  def fields
    field :name
    field :city, hide_on: :index
  end

  def filters
    add_filters_for_all_fields
  end
end

Output: The course index page should have 1 filter, for name

Copy link
Contributor

github-actions bot commented Jan 6, 2025

This issue has been marked as stale because there was no activity for the past 15 days.

@github-actions github-actions bot added the Stale label Jan 6, 2025
@Paul-Bob Paul-Bob moved this to To Do in Issues Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Do
Development

No branches or pull requests

2 participants