0
votes

i had three models Product Category and Heureka product is assigned to one category and each one category can be optionaly mapped to heureka Fullname.

i am looking how to write filter on active Admin product page on category.category_name or at heureka.fullname

class Category < ActiveRecord::Base
has_many :product
has_one :heureka
end


class Heureka < ActiveRecord::Base
  belongs_to :category
end


class Product < ActiveRecord::Base
  belongs_to :category
end
1

1 Answers

0
votes

ActiveAdmin uses Ransack gem to create search form as filter. Unfortunately it isn't well documented, you have to dig in the source code.

See more: https://github.com/activerecord-hackery/ransack