For how to use ActiveHash, please refer to the previously posted here.
When you want to display the data saved in ActiveHash in the view, only the column name will display the numerical value.
ex)
item.prefecture.name
If you add name
after the column name, the character string associated with id will be displayed.
Recommended Posts