2012-03-19 2 views
0

Rails에서 collection_select의 기본 너비를 설정해야합니다. 나는이 시도했지만 작동되지 않습니다 Rails에서 collection_select의 기본 너비 설정

<%= u.collection_select :program_id, Program.where(:status => true), :id, :name , :include_blank=> true, :class=>'foo'%> 

도 해봤 : 어떤 아이디어를

<%= u.collection_select :program_id, Program.where(:status => true), :id, :name , :include_blank=> true, {:class=>'foo'}%> 

<%= u.collection_select :program_id, Program.where(:status => true), :id, :name , :include_blank=> true, :style=>'width:50%'%> 

그들은 작동하지 않았다?

+0

''foo'' 클래스는 CSS 파일에서 어떻게 보입니까? – ScottJShea

+0

@ScottJShea 클래스는 다음과 같이 보일 수 있습니다.'.foo { width : 23px; }' – Daisy

답변

0

마지막으로 나는 그것을 알아낼 : 그것은 지금 작동

<%= u.collection_select :program_id, Program.where(:status => true), :id, :name , {:include_blank=> true}, {:class=>'foo'}%> 

!