代码之家  ›  专栏  ›  技术社区  ›  whirlwin

轨道文本\区域大小

  •  69
  • whirlwin  · 技术社区  · 14 年前

    我有一个 text_area 里面 fields_for ,位于 form_for .

    <%= day_form.text_area :hatch %>
    

    是否可以改变 文本区域 ?例如: day_form.text_area size: 5 .

    3 回复  |  直到 8 年前
        1
  •  133
  •   Kris    9 年前

    <%= day_form.text_area :hatch, cols: "30", rows: "10" %>
    

    <%= day_form.text_area :hatch, size: "30x10" %>
    
        2
  •  3
  •   Kris    9 年前

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

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

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

        3
  •  2
  •   fatfrog    8 年前

    <%= f.text_area :description, :rows => 10, style: 'width:100%;' %>