繁体   English   中英

如何在simple_form中调整文本框的高度?

[英]How do you resize a text box height in simple_form?

我可以弄清楚如何使用simple_form更改文本框的高度。 我需要修改CSS吗?

这是我的代码

```

.well/
= simple_form_for @document do |f|
  = f.input :title
  = f.input :content, :input_html => {:rows =>10} 
  = f.button :submit 

```

你可以这样

<%= f.input :message, :input_html => {:rows => 10} %>

简单修复,将输入更改为文本区域

= f.text_area :content, :input_html => {:rows => 10} 

您将需要像这样告诉simple_form您正在使用text_box,它将起作用:

HAML

= f.input :content, as: :text, input_html: {rows: 9}

HTML

<%= f.input :content, as: :text, input_html: {rows: 9} %>

希望能帮助到你 :)

暂无
暂无

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

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