Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails, select helper, adding style

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.

like image 860
thenengah Avatar asked Feb 20 '10 10:02

thenengah


1 Answers

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' }
like image 130
Jimmy Avatar answered Sep 30 '22 18:09

Jimmy