ビューはこのコードで大丈夫を示しています
<%= community.country_id %>
<%= community.country.name %>
しかし、これはエラーを返します
'Mysql2 :: Error:Unknown column' countrys.community_id'in' whereclause':SELECT
countries
。*countries
FROMWHEREcountries
。community_id
= 5 LIMIT 1 '
私のモデルは
community.rb
has_one :country
country.rb
belongs_to :community