Rails - ActiveAdmin - Filter another model -
i use rails 4.2.4, , activeadmin gem.
i have 2 models.
user model: email:string, password: string.
user model has_one user detail.
userdetail belongs_to user, have name:string.
but, filter name in
activeadmin.register user filter :name end i don't see name field.
thanks.
you have use appropriate filter associated model. can like:
activeadmin.register user filter :user_detail_name end where name attribute of userdetail model.
update: forgot mention activeadmin utilizes ransack search under hood. based on can use ransack's syntax setup filters. here couple of resources prove helpful:
Comments
Post a Comment