简体   繁体   English

命名表单助手文本f.input

[英]Naming form helper text f.input

I am using 我在用

<%= f.input :firstName %> 

where firstName is a field in the user model 其中firstName是用户模型中的字段

However, the text beside the input box comes as firstName, is there a way to change the text beside the input box to first_name instead? 但是,输入框旁边的文本为firstName,是否可以将输入框旁边的文本更改为first_name?

尝试`<%= f.input:firstName,“ first_name”%>

如果您使用的是simple_form gem,请尝试一下

  <%= f.input :firstName, label: 'first_name' %>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM