can't change the height of a text field in simple_form

Linoux picture Linoux · Nov 26, 2012 · Viewed 17.4k times · Source

I've tried

  #Default size for text inputs.  
  config.default_input_size = 10

from config/initializers/simple_form.rb

I've also tried <%= f.input :message, :input_html => {:size => 10} %>

But neither of these change a single thing about how my text fields appear.

Answer

Super Engineer picture Super Engineer · Nov 26, 2012

You need to do this

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

Html text area tag attributes has two attributes namely rows and cols which lets you specify the no of rows and columns(i.e. width) of your text area. If this is not working then open the console and see if your css is overriding the height.