Rails: Titlecase Only Capitalizes First Word in f.label

后端 未结 3 705
名媛妹妹
名媛妹妹 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 00:57

    I can't comment because of my rep. To answer webaholik's question, you can use label_tag in this case:

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

提交回复
热议问题