Rails - submit_tag with bootstrap input-group-addon span class

时间:2014-07-20 17:22:48

标签: css ruby-on-rails ruby twitter-bootstrap haml

我有一个Rails应用程序,其中我有一个表单,我希望使用text_fieldsubmit_tag使用bootstrap的input-group-addon span类。在此页面上:bootstrap input groups

我的表单目前看起来像这样:

.input-group
  = text_field_tag :search, params[:search], placeholder: "Filter...", class: "form-control no-border-radius"
  = submit_tag "<span class=\"input-group-addon\">Search</span>".html_safe

但它没有我想要的Bootstrap样式。那么,应用范围样式的正确方法是什么submit_tag

1 个答案:

答案 0 :(得分:1)

认为这就是你所追求的:

.input-group
  = text_field_tag :search, params[:search], placeholder: "Filter...", class: "form-control no-border-radius"
  %span.input-group-btn
    = submit_tag "Search", class: "btn btn-default"