簡體   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