简体   繁体   中英

Rails Active Admin custom queries for resource

I have a resource and I want to show information from another related table in the index view. How do I go about this?

Thanks for the help. The answer is:

 column "Account ID" do |refund|
  Account.find_by_character_name(refund.character_name).id
end

您还可以与关系查询它

column ("Car Model") { |user| user.car.attribute_name if user.car }

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