我试图做这样的事情。Rails,选择助手,添加样式
select :model, :attribute, :style => "some:style;"
添加style
在轨select helper
,但它不工作。
我试图做这样的事情。Rails,选择助手,添加样式
select :model, :attribute, :style => "some:style;"
添加style
在轨select helper
,但它不工作。
select(object, method, choices, options = {}, html_options = {})
所以你:style
哈希需要是第五个参数。例如:
select(:model, :attribute, @options_for_select, { }, { :style => 'some: style' }
我可以什么样的风格。 – s84 2010-02-20 11:02:07
任何你想要的。最后一个参数只是在select元素上创建HTML属性,所以像这样的散列: ''::'style =>'display:inline;' }' 将创建: '' – 2010-02-20 11:18:01
这是一个非常严重的问题,我试图找到答案,并应得到很多赞成票。 – vsync 2011-11-10 14:31:16