Ruby on rails 如何使用Rails使文本框更宽?
我试着用以下方法来实现这一点:Ruby on rails 如何使用Rails使文本框更宽?,ruby-on-rails,ruby-on-rails-4,Ruby On Rails,Ruby On Rails 4,我试着用以下方法来实现这一点: <%= current_user.first_name %> <%= current_user.last_name %> <span class="bubble"> <%= best_in_place current_user, :blurb, type: :textarea, :cols => "30", :rows => "50",
<%= 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>
"30",
:行=>“50”,
:internal_class=>“职业编辑”,
无:“添加一个简短的简介(最多140个)”
%>
然而,这是行不通的。是否可以使文本区域的长度与垂直长度相同?它似乎不能用“最好的地方”宝石定制 通过使用,可以设置这些类型的参数,如下所示:
<%= best_in_place current_user,
:blurb,
:type => :textarea,
:html_attrs => { :cols => '30', :rows => '50' }
%>
<%= best_in_place current_user,
:blurb,
:type => :textarea,
:html_attrs => { :style => 'width:500px; height:500px;' }
%>
谢谢@summea,这更好不过,科尔斯:“30”仍然没有让它像在垂直方向上那样变长。这里似乎只有行在工作,我做错了什么?嗨,桑尼,
cols
和rows
似乎都在我的测试应用程序中工作。。。你能复制/跳过你正在使用的代码行吗?当然可以,:textarea,:html_attrs=>{cols:'5000',rows:'1'},nil:'Add short blurb(max 140)%>谢谢;试试这个::textarea,:html\u attrs=>{:cols=>'5000',:rows=>'1'},:nil=>'添加一个简短的模糊(最大140)%>
谢谢@summea,仍然没有更改文本区域的长度。出什么事了?