[英]Rails form_for, having a text_field without a label (without using CSS)
I know this is easy enough just removing the f.label, but then it changes the positioning (ie, would have to add padding). 我知道这很容易,只需删除f.label,但是它会更改位置(即,必须添加填充)。
Is there a way to do this without styling? 有没有办法做到这一点而无需样式?
I tried 我试过了
f.label :example, ""
But that would still yield 'Example' 但这仍然会产生“示例”
Any input is appreciated. 任何输入表示赞赏。
It certainly is a BAD PRACTICE to do what you are asking. 当然,按照您的要求去做是不好的做法。
What I would do is, 我会做的是
<th></th>
) for the labels as the first row (<tr></tr>)
in html and the remaining text_fields as subsequent rows. <th></th>
)用作html中的第一行(<tr></tr>)
,并将其余的text_fields用作后续行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.