I’ve tried a bunch of different permutations but can’t get the style
width to even appear in the html output. Putting the style hash in
braces with or with the “html_options =” explicitly called out doesn’t
help. I’ve Googled and looked at the API but can figure this one out.
The docs say that last two arguments are both hashes, so if you don’t
encapsulate the :prompt with {}'s then I think ruby is going to consider everything from that point on to be part of options, not
html_options…
I know this is old, but I’m bumping it because it helped me out. Also,
one other tip for collection_select:
If you don’t need the prompt, you can use this:
…, {}, { “style” => “width:200px” }
But note that none of these are good ideas. Style attributes do not
belong in good HTML. Instead, use a separate CSS file. (For best
results, add Sass and Compass into the mix.)