Rails, select helper, adding style

后端 未结 1 834
野性不改
野性不改 2021-02-13 05:21

I\'m trying to do something like this.

 select :model, :attribute, :style => \"some:style;\" 

Add style to the select hel

1条回答
  •  孤城傲影
    2021-02-13 05:47

    From the documenation:

    select(object, method, choices, options = {}, html_options = {})

    So your :style hash needs to be the 5th parameter. For example:

    select(:model, :attribute, @options_for_select, { }, { :style => 'some: style' }
    

    0 讨论(0)
提交回复
热议问题