google1254
google1254

Reputation: 157

Rails how to make form_for input text area wider?

I'm trying to make the input field wider but I can only make it longer. I've tried other suggestions on stackoverflow like "cols" => 50 but that does't do anything.

I have this currently.

    <%= f.text_area  :text, "width" => 80, "rows" => 20 %>

And width doesn't work either, any ideas?

Upvotes: 2

Views: 1244

Answers (2)

coding addicted
coding addicted

Reputation: 3430

You can use cols and rows, but i usually use css to style the form. You can set a class to this text area:

<%= f.text_area :text, class: "your_class" %>

And then in your stylesheets:

.your_class{
  width:100%;
}

Here is the doc for more details: doc

Upvotes: 3

Rafa Paez
Rafa Paez

Reputation: 4870

This code should work

<%= f.text_area :text, :cols => 80, :rows => 20 %>

Upvotes: 2

Related Questions