繁体   English   中英

simple_form引导程序输入

[英]simple_form bootstrap input

我是html和erb的新手,使用自定义simple_form时遇到了问题。

我需要翻译此html.erb输入

<%= object.input :attribute, label: 'mylabel' %>

到此html输入类型

<label class="col-sm-3 control-label">mylabel</label>
<div class="col-sm-9">
  <input class="form-control">
</div>

您需要添加:horizontal_forml包装器和'form-horizontal'类来form

<%= simple_form_for @post, html: { class: 'form-horizontal' }, wrapper: :horizontal_form do |f| %>
  <%= f.input :attribute, label: 'mylabel' %>
<% end %>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM