a busy cat http://bryancorrell.com/FilterButton.PNG引導輸入按鈕不能與其他領域的
我能解決這個問題對齊排列,但後來我失去了對輸入的圓角和無法弄清楚如何讓他們回來。請參見下面的鏈接:
https://jsfiddle.net/yzw8q28q/5/
<form class="simple_form form-inline" novalidate="novalidate" action="/dashboard/school" accept-charset="UTF-8" method="get">
<div class="form-group select required filter_discipline_id">
<select class="select required form-control" placeholder="Discipline" name="filter[discipline_id]" id="filter_discipline_id">
<option value="">- Discipline -</option>
<option selected="selected" value="1">HW</option>
<option value="2">SW</option>
</select>
</div>
<div class="form-group">
<input type="submit" name="commit" value="Filter" class="btn btn-default btn btn-primary form-control" />
</div>
</form>
<br /><hr /><br />
<div class="input-group">
<form class="simple_form form-inline" novalidate="novalidate" action="/dashboard/school" accept-charset="UTF-8" method="get">
<div class="form-group select required filter_discipline_id">
<select class="select required form-control" placeholder="Discipline" name="filter[discipline_id]" id="filter_discipline_id">
<option value="">- Discipline -</option>
<option selected="selected" value="1">HW</option>
<option value="2">SW</option>
</select>
</div>
<div class="form-group">
<input type="submit" name="commit" value="Filter" class="btn btn-default btn btn-primary form-control" />
</div>
</form>
</div>
的Ruby代碼正在生成的HTML表單:
<%= minimal_form_for :filter, url: @form_path, method: :get, html: {class: 'form-inline' } do |f| %>
<%= f.error_notification %>
<%= f.input :discipline_id,
collection: Discipline.all,
include_blank: '- Discipline -',
selected: params[:discipline_id] %>
<div class="form-group">
<%= f.button :submit, 'Filter', class: "btn-primary form-control" %>
</div>
看起來simple_form被注入了 「BTN」 級。不知道如何停止。
感謝您的迴應 - 類是重複的,因爲我simple_form默認情況下在按鈕上放置class =「btn btn-default」。我刪除了我的「btn」注入,但我該如何停止simple_form?我在上面添加了我的Ruby/Rails代碼 - 對不起,最初沒有包含它。 –
我對Ruby/Rails或simple_form一無所知,但是,你可以像「f.input」那樣傳遞「f.button」並查看會發生什麼嗎? – rmjoia
好主意 - 我擺弄了一下,看起來像f。提交不注入class =「btn」: <%= f.submit'Filter',class:「btn-primary form-control」%> –