How to translate enum into Japanese and generate linked radio buttons

Thing you want to do

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.

About Japanese localization of enum

It will be translated into Japanese according to the contents of this article.

Describe the radio button linked to the Japanese enum

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

How to translate enum into Japanese and generate linked radio buttons
[Rails] How to translate devise into Japanese
How to translate Rails into Japanese in general
How to build SquashTM and how to support Japanese
How to use enum (introduction of Japanese notation)
[Ruby on Rails] How to write enum in Japanese
Install Eclipse on Mac and translate it into Japanese
Think about how to divide MVC into M and V
[Rails] How to use enum
[Rails] How to use enum
How to use StringBurrer and Arrays.toString.
How to use EventBus3 and ThreadMode
[Rails] How to write in Japanese
How to call classes and methods
How to use equality and equality (how to use equals)
How to connect Heroku and Sequel
How to convert LocalDate and Timestamp
How to use Java enum type
How to translate the error message into Japanese (What to do if you cannot log in for some reason)