我尝试过以下操作:
<%= current_user.first_name %>
<%= current_user.last_name %>
<span class="bubble">
<%= best_in_place current_user,
:blurb,
type: :textarea,
:cols => "30",
:rows => "50",
:inner_class => 'occupation-edit',
nil: 'Add a short blurb (max 140)'
%>
</span>
但是,这不起作用。是否可以将文本区域设置为垂直长度?看起来它不能用'best_in_place'宝石定制。
答案 0 :(得分:6)
使用html_attrs
,您可以设置这些类型的参数,如下所示:
<%= best_in_place current_user,
:blurb,
:type => :textarea,
:html_attrs => { :cols => '30', :rows => '50' }
%>
如果rows
和cols
属性不起作用,您可能需要尝试style
属性,如下所示:
<%= best_in_place current_user,
:blurb,
:type => :textarea,
:html_attrs => { :style => 'width:500px; height:500px;' }
%>