Select with country names

Hi,

I need to create a list of coutries in a driop down.

I’m aware of a function ‘country_options_for_select’ however this jsut
seems to output a string of all countires.

How can I get this list in a drop down?

Thanks
scott

Scott,

Assuming your model Account has a country text attribute:

<%= country_select :account, :country %>

Hope this helps,
Zack

Hi Scott,

try (untested)

<%= select_tag(“country”,
country_options_for_select) %>

You might also have a look at:
http://rails.techno-weenie.net/tip/2006/6/5/country_select_with_country_codes

Cheers,
Jan

Hi,
You can use country_select.

Att.,
Romeu Fonseca

-----Mensagem original-----
De: [email protected]
[mailto:[email protected]] Em nome de scott
Enviada em: quarta-feira, 9 de agosto de 2006 05:10
Para: [email protected]
Assunto: [Rails] select with country names

Hi,

I need to create a list of coutries in a driop down.

I’m aware of a function ‘country_options_for_select’ however this jsut
seems to output a string of all countires.

How can I get this list in a drop down?

Thanks
scott


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 7/8/2006


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.8/414 - Release Date: 9/8/2006

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs