如何在 rails 中显示我的伙伴?

how to show my associate in rails?

我用过

f.association :estado, collection:@estados, value_method: :id, label_method: :nome, required: true, prompt: "Please Select" 

保存我的关联,现在去 "index" 给我看看

Estado:0x00007f09fdcc99e0>

是我的第一个post对不起。

如果有帮助,我正在使用 rails 5.1

输出:

Estado 是一个模型,也是您数据库中的一个 table。可能与地址相关联。使用:

@address.estado.name #assuming address is the instance variable.