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.
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.
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.
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