[英]How do you resize a text box height in simple_form?
I can figure out how to change the text box height with simple_form. 我可以弄清楚如何使用simple_form更改文本框的高度。 Do i need to modifiy the css?
我需要修改CSS吗?
here is my code 这是我的代码
``` ```
.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}
You will need to tell simple_form that you are using a text_box, like this and it will work: 您将需要像这样告诉simple_form您正在使用text_box,它将起作用:
= f.input :content, as: :text, input_html: {rows: 9}
<%= f.input :content, as: :text, input_html: {rows: 9} %>
Hope it helps :) 希望能帮助到你 :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.