# How to add a class to country\_select field

**URL:** <https://www.ruby-forum.com/t/how-to-add-a-class-to-country-select-field/78933>\
**Category:** Rails\
**Created:** [December 10, 2006, 8:56pm UTC](https://www.ruby-forum.com/t/how-to-add-a-class-to-country-select-field/78933 "2006-12-10T20:56:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jon](https://www.ruby-forum.com/u/jon)\
**Post date:** [December 10, 2006, 8:56pm UTC](https://www.ruby-forum.com/t/how-to-add-a-class-to-country-select-field/78933/1 "2006-12-10T20:56:45Z")

</div>

\<%=country\_select ‘user’, ‘country’%\>

I have the above field, how can I add a class to this?

The api says this, if someone could explain how to get to the  
html\_options bit, without the others, that would be great?

country\_select(object, method, priority\_countries = nil, options = {},  
html\_options = {})

---

<div class="post-metadata">

**Author:** ![jon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jon](https://www.ruby-forum.com/u/jon)\
**Post date:** [December 10, 2006, 11:42pm UTC](https://www.ruby-forum.com/t/how-to-add-a-class-to-country-select-field/78933/2 "2006-12-10T23:42:17Z")

</div>

I’m not sure, I’ve been just doing:  
\<%=country\_select ‘user’, ‘country’, nil, {}, {:class=\>‘some-class’} %\>

but I’m hoping there’s a nicer way. If there isn’t, you could always  
create your own helper which uses the existing one.
