2012-03-19 4 views
0

Мне нужно установить ширину по умолчанию для collection_select в Rails. Я попытался это, но он не работает:установка ширины по умолчанию для collection_select в Rails

<%= 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'}%> 

Он работает сейчас!

Смежные вопросы