shou2017.com
JP

How to increase the height of a text area in Rails

Sat Sep 9, 2017
Sat Aug 10, 2024

Using Bootstrap 3.

When creating a form screen, there are times when you want to increase the number of rows for a text area, such as for an inquiry form. Here’s a memo for that case. I want it to look like this:

<textarea class="form-control" rows="3">Content</textarea>

To achieve this in a Rails view, you can do the following:

<%= f.text_area :content, :rows => "3", class: "form-control", placeholder: "Content" %>
See Also