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

前端 未结 8 1652
耶瑟儿~
耶瑟儿~ 2021-02-19 02:22

I\'ve tried

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

from config/initializers/simple_form.rb

I\'ve also tri

8条回答
  •  遥遥无期
    2021-02-19 02:52

    I managed to do this by adding :as => :text to the input field attributes and then adding style & rows to the input html:

    <%= f.input :message, label: "Message: ", :as => :text, input_html: { :style=> 'width: 100%;', :rows => 4} %>
    

    For me it was the :as => :text that got the "rows" attribute to work, and the 100% width made it fluid rather than fixed-width.

提交回复
热议问题