LoginSignup
1
0

More than 1 year has passed since last update.

【Rails】f.labelで最初の文字のみ大文字になってしまう

Posted at

環境

Ruby 3.0.2
Rails 6.1.4.1

状況

html.slim
...
= f.label 'ID'

最初の文字のみが大文字で、「Id」と表示されてしまう

解決法

html.slim
...
= f.label :id, 'ID'
f.label(メソッド名 [, ラベル配下のコンテンツ, オプション])

第1引数にオブジェクトのメソッド名が来ることを想定しているため、第2引数にラベル名を指定する

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0