<%= current_user.first_name %><%= current_user.last_name %><span > <%= 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’宝石定制.
解决方法 通过使用html_attrs
,您可以设置这些类型的参数,如下所示: <%= best_in_place current_user,:type => :textarea,:HTML_attrs => { :cols => '30',:rows => '50' }%>
如果rows和cols属性不起作用,您可能想尝试style属性,如下所示:
<%= best_in_place current_user,:HTML_attrs => { :style => 'wIDth:500px; height:500px;' }%>总结
以上是内存溢出为你收集整理的ruby-on-rails – 如何使用Rails best_in_place使文本框更宽?全部内容,希望文章能够帮你解决ruby-on-rails – 如何使用Rails best_in_place使文本框更宽?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)