Forum: Ruby on Rails Width of selectbox ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5c27aa958030eed6817e4b2295d2040b?d=identicon&s=25 Ja Bo (jabo)
on 2006-12-30 18:24
Sorry for this question, I am still quiet new to Rails and sometimes can
not find my answers in my RoR books or on the Internet...

I made a selectionbox with the following code :
  <%= select('company', 'city', @cities) %>
This actually works very fine, but I would like to have some control on
the width of the selection box, so that it is not dependent upon the
entries in @cities...
3ff9c2544554b13c6c7877e76684751b?d=identicon&s=25 Lee Smith (smitjel)
on 2006-12-30 18:40
(Received via mailing list)
Try this

<%= select('company', 'city', @cities, {}, {:style => "width: 200px"})
5c27aa958030eed6817e4b2295d2040b?d=identicon&s=25 Ja Bo (jabo)
on 2006-12-30 19:02
Thank you very much, so easy, I actually tried a couple of things that
came very close, but just missed it..

Thank you very much again !

Jl Smith wrote:
> Try this
> <%= select('company', 'city', @cities, {}, {:style => "width: 200px"})
> %>
This topic is locked and can not be replied to.