加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails-3 – 如何使用Simple Form Bootstrap gem的input-

发布时间:2020-12-17 02:43:51 所属栏目:百科 来源:网络整理
导读:我想我错过了. The example application for simple_form-bootstrap从未显示如何使用input-append.我尝试了其他几种方法,但它们没有用. div class="controls" div class="input-append" input type="text" size="16" id="appendedInput" class="span2" span
我想我错过了. The example application for simple_form-bootstrap从未显示如何使用input-append.我尝试了其他几种方法,但它们没有用.

<div class="controls">
 <div class="input-append">
  <input type="text" size="16" id="appendedInput" class="span2">
   <span class="add-on">.00</span>
 </div>
   <span class="help-inline">Here's more help text</span>
</div>

我需要这个,所以Bootstrap使用的错误消息显示出来,我能够以某种方式设计我的表单.如何在horizontal form上使用附加组件和帮助内联?

提前致谢!

解决方法

好的,简单的表单引导程序确实支持它.我应该像前置一样看看追加.例如:

<%= simple_form_for(@article,:html => { :class => 'form-horizontal' }) do |f| %>
  <%= f.input :name,:wrapper => :append,:class => "inline" do %>
   <%= f.input_field :name %>
    <%= content_tag :span,"?",:class => "add-on abbn" %>
   <% end %>
   <div class="form-actions">
    <%= f.button :submit,:class => 'btn-primary' %>
   </div>
<% end %>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读