I’ve the following Category model :
class Category < ActiveRecord::Base
belongs_to :parent, :class_name => "Category", :foreign_key => "parent_id"
has_many :categories, :class_name => "Category", :foreign_key => "parent_id"
end
and I want to be able to filter by parent category and select the parent category in add / edit categories
The problem was with column ‘name’, as ActiveAdmin is looking for column ‘name’, but in my case I don’t have this column. So, I update my model to have ‘name’ method. Then it works fine