我正在尝试这样做。
select :model, :attribute, :style => "some:style;"
将style
添加到rails中的select helper
,但它无效。
答案 0 :(得分:21)
来自documenation:
select(object, method, choices, options = {}, html_options = {})
所以你的:style
哈希需要成为第五个参数。例如:
select(:model, :attribute, @options_for_select, { }, { :style => 'some: style' }