Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails文本区域大小_Ruby On Rails - Fatal编程技术网

Ruby on rails Rails文本区域大小

Ruby on rails Rails文本区域大小,ruby-on-rails,Ruby On Rails,我在的字段中有一个文本区域,它在的表单中 <%= day_form.text_area :hatch %> 是否可以更改文本区域的大小?例如:day\u form.text\u区域大小:5您可以选择: <%= day_form.text_area :hatch, cols: 30, rows: 10 %> 或者,您可以使用“大小”属性指定这两者: <%= day_form.text_area :hatch, size: "30x10"

我在的
字段中有一个
文本区域
,它在
表单中

<%= day_form.text_area :hatch %>


是否可以更改
文本区域的大小
?例如:
day\u form.text\u区域大小:5

您可以选择:

<%= day_form.text_area :hatch, cols: 30, rows: 10 %>

或者,您可以使用“大小”属性指定这两者:

<%= day_form.text_area :hatch, size: "30x10" %>

由于文本区域既有行又有列,因此必须同时指定行和列

<%= text_area(:application, :notes, cols: 40, rows: 15, class: 'myclass') %>

对于文本字段,可以使用

<%= text_field(:application, :name, size: 20) %>


对于响应性,我喜欢将文本区域宽度设置为100%:


这现在不起作用了,有没有一个rails 3.1解决方案与此不同?我没有看到提到这一点,但您也可以这样写:“60%x5%”%>这是在rails 4.0.0中,我必须将f.text\u字段更改为f.text\u区域。