Rails 文本区域大小 [英] Rails text_area size

查看:43
本文介绍了Rails 文本区域大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 fields_for 中有一个 text_area,它在 form_for 内.

I have a text_area inside a fields_for, which is inside a form_for.

<%= day_form.text_area :hatch %>

是否可以更改text_area 的大小?例如:day_form.text_area size: 5.

Is it possible to change the size of the text_area? For example: day_form.text_area size: 5.

推荐答案

你可以选择:

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

或者您可以使用 size 属性指定两者:

or you can specify both with the size attribute:

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

这篇关于Rails 文本区域大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆