Rails: Titlecase Only Capitalizes First Word in f.label

后端 未结 3 747
名媛妹妹
名媛妹妹 2021-02-04 00:40

The first line of code does what I want, the second only capitalizes the first word:

<%= the_label = \"Time_Balance\".titlecase %>
<%= f.lab
3条回答
  •  轮回少年
    2021-02-04 01:06

    F! What if I can't use "f." ?

    ..such as a secondary filter that doesn't reference a valid attribute

    <%= label :time_balance, "Time Balance" %> 

提交回复
热议问题