0

I am using mailboxer gem and have this code:

  <%= label :body, "Message text" %>
  <p><%= text_area_tag :body %></p>

How can I make the text_area_tag section larger and generally insert css styling? Thanks.

zkidd
  • 513
  • 1
  • 5
  • 18

2 Answers2

2

Personally, I'd use CSS, but see this discussion where using both HTML and CSS is advocated.

So with the view erb:

<div class="body_input">
  <%= label :body, "Message text" %>
  <p><%= text_area_tag :body, @body %></p>
</div>

Then in CSS:

.body_input textarea {
  width: 30em;
  heigth: 15em;
}

The CSS width and height you can alter to match your requirement.

Community
  • 1
  • 1
ReggieB
  • 8,100
  • 3
  • 38
  • 46
0

I have to reference the :body and it works.

  <%= label :body, "Message text" %>
  <p><%= text_area_tag :body, @body, :size =>"25x10" %></p>

From this answer: How to change size of text_area_tag helper in ruby on rails

Community
  • 1
  • 1
zkidd
  • 513
  • 1
  • 5
  • 18