我正在使用ruby on rails應用程序並嘗試減小select的大小。我爲我的應用程序安裝了「bootstrap gem」。 下面是代碼bootstrap類不與選擇
<%= f.select :fromyear, (1995..Time.now.year).to_a.reverse,
:include_blank => {:year => "Select year"}, :class=>"input-small" %>
,因爲我注意到從這個問題Change width of select tag in Twitter Bootstrap類值。但似乎它不適用於此選擇。我已經嘗試過
<%= f.select :fromyear, (1995..Time.now.year).to_a.reverse,
:include_blank => {:year => "Select year"}, :style=>"100px" %>
但是什麼也沒有發生。 Plz讓我知道我失蹤了。謝謝
請告訴你使用'simple_form '或內置'form_for'? –
@Monk_Code我正在使用'form_for' –
我在其他頁面上使用form_for。它在這個觀點上工作得很好 –