简体   繁体   中英

Ruby in Rails - Activeadmin - :filter Age from Birthday column

I have a little problem. In my DB I have a column :birthday . Format is Date: "1999-12-1" for example. But I want to have a filter for age in my page.

Is there an easy way to calculate it ? filter :birthday.age or something? I know this sounds easy, but I can't make it work.

我不会说“简单”,但是在Wiki上有一些关于Ransack的自定义过滤器的文章。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM