开发者

Rails, select helper, adding style

开发者 https://www.devze.com 2022-12-20 15:04 出处:网络
I\'m trying to do something like this. select :model, :attribute, :style => \"some:style;\" Add style to the select 开发者_如何学编程helper in rails, but it is not working.From the documenatio

I'm trying to do something like this.

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

Add style to the select 开发者_如何学编程helper in rails, but it is not working.


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

精彩评论

暂无评论...
验证码 换一张
取 消