I want to express the following enum with radio buttons.
enum loadtype: { normal: 0, trail: 1, beach: 2, track: 3 }
And I want the options to come out in Japanese.
It will be translated into Japanese according to the contents of this article. https://qiita.com/tanutanu/items/d44a92425188a4489ec6
Described as follows in View Form
<%= f.collection_radio_buttons :loadtype, Post.loadtypes_i18n, :first, :last %>
The meaning of the code is as follows
<%= f.collection_radio_buttons [column name], [Collection to be displayed], [value], [Character string to be displayed in text] %>
Recommended Posts