caffeinescript
caffeinescript

Reputation: 1411

How do you resize a text box height in simple_form?

I can figure out how to change the text box height with simple_form. Do i need to modifiy the css?

here is my code

```

.well/
= simple_form_for @document do |f|
  = f.input :title
  = f.input :content, :input_html => {:rows =>10} 
  = f.button :submit 

```

Upvotes: 1

Views: 2032

Answers (3)

user5048032
user5048032

Reputation:

You can do like this,

<%= f.input :message, :input_html => {:rows => 10} %>

Upvotes: 1

caffeinescript
caffeinescript

Reputation: 1411

simple fix, change input to text area

= f.text_area :content, :input_html => {:rows => 10} 

Upvotes: 1

Demi Magus
Demi Magus

Reputation: 3437

You will need to tell simple_form that you are using a text_box, like this and it will work:

haml

= f.input :content, as: :text, input_html: {rows: 9}

html

<%= f.input :content, as: :text, input_html: {rows: 9} %>

Hope it helps :)

Upvotes: 0

Related Questions