Rails text_area size

前端 未结 3 1761
清酒与你
清酒与你 2021-01-31 07:19

I have a text_area inside a fields_for, which is inside a form_for.

<%= day_form.text_area :hatch %>
3条回答
  •  日久生厌
    2021-01-31 07:27

    As text area has both row and column you have to specify both

    <%= text_area(:application, :notes, cols: 40, rows: 15, class: 'myclass') %>
    

    For text field can use

    <%= text_field(:application, :name, size: 20) %>
    

    http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-text_area

提交回复
热议问题