我正在使用simple_form_for
生成表單。Rails - 如何在simple_form_for表單中添加自己的標籤?
這是一種標準的方式如何呈現輸入:
<%= f.input :password, input_html: { class: 'textinput' }, :required => true, :autofocus => true, :placeholder => 'this is heavy' %>
論simple_form
官方Github的頁面顯示這種方式來做到這一點:
<%= f.input :password, label: 'Password (at least 8 characters)', input_html: { class: 'textinput' }, :required => true, :autofocus => true, :placeholder => 'this is heavy' %>
但是,當我將它設置這樣,標籤仍然說密碼,而不是密碼(至少8個字符)。
我在做什麼錯?