[Rails] Change the label name of f.label

problem

Only the item to enter the user name on the new registration screen is "name" in English, so I want to change it to "user name" in Japanese.

Solution

ruby:app/views/devise/registrations/new.html.haml


# before
.field-label
  = f.label :name
  ↓
# after
.field-label
  = f.label :name, "username"

How it changed

before スクリーンショット 2020-10-02 午後4.24.12.png

after スクリーンショット 2020-10-02 午後4.23.10.png

Reference article

How to use form.label

Recommended Posts

[Rails] Change the label name of f.label
[Rails] How to change the column name of the table
[Rails] Addition of columns / Change of data type / column name
[Ruby on Rails] How to change the column name
[Rails] Get the path name of the URL before the transition and change the link destination
[Rails] Cancel / change the default password validation of devise
Change the file name and output destination of the JavaVM error file
[Rails] When the layout change of devise is not reflected
[Rails] Check the contents of the object
[Swift] Change the textColor of UIDatePicker
Check the migration status of rails
[Ruby on Rails] Change the save destination of gem refile * Note
[Rails] How to change the page title of the browser for each page
Change the default timezone for the rails app
The identity of params [: id] in rails
part of the syntax of ruby ​​on rails
[Eclipse] Change the color of the vertical ruler
Bootstrap4 Change the color of the hamburger menu
[Swift] Change the color of SCN Node
The process of introducing Vuetify to Rails
Change the save destination of the image to S3 in the Rails app. Part 2
[Order method] Set the order of data in Rails
[Rails 6] Change redirect destination at the time of new registration / login by devise
[Rails] Button to return to the top of the page
[Ruby on Rails] Until the introduction of RSpec
Change the timezone of the https-portal container to JST
Rename the package name of the existing jar file
Change the port name and execution authority of the microcomputer connected to Ubuntu and LiDAR
How Microservices Change the Way of Developing Applications
[AndroidStudio] Change the color of the ActionBarDrawerToggle hamburger menu
Change the location folder of Docker image & container
The official name of Spring MVC is Spring Web MVC
[rails] After option useful when you want to change the order of DB columns
A review of the code used by rails beginners
[Kotlin] Get the argument name of the constructor by reflection
Docker the development environment of Ruby on Rails project
Get the name of the test case in the JUnit test class
[Ruby on Rails] Change URL id to column name
<Android> Change the background color of the List row of ListView
I summarized the display format of the JSON response of Rails
Read the Rails Guide (Overview of Action Controller) again
Rails6: Input the initial data of ActionText using seed
Ruby, Nokogiri: Get the element name of the selected node
Change the storage quality of JPEG images in Java
[Rails] How to get the contents of strong parameters
SSL in the local environment of Docker / Rails / puma
Roughly the flow of web application development with Rails.
I can't get out of the Rails dbconsole screen
Automatically set the width and height of the UI Label
Try using the query attribute of Ruby on Rails
The world of clara-rules (2)
[Rails] Introduction of PAY.JP
Judgment of the calendar
The world of clara-rules (4)
The world of clara-rules (1)
The world of clara-rules (3)
The world of clara-rules (5)
The idea of quicksort
Master the [Rails] scope!
The idea of jQuery
[Rails] Put the same restrictions on multiple pieces of information