Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails text_area size

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

<%= day_form.text_area :hatch %> 

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

like image 849
whirlwin Avatar asked Nov 19 '10 10:11

whirlwin


2 Answers

You could either go with:

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

or you can specify both with the size attribute:

<%= day_form.text_area :hatch, size: "30x10" %> 
like image 190
DanneManne Avatar answered Oct 07 '22 02:10

DanneManne


For responsiveness I like to make the text area width 100% :

<%= f.text_area :description, rows: 10, style: 'width:100%;' %>

like image 29
fatfrog Avatar answered Oct 07 '22 02:10

fatfrog