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/.
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 On 8/9/06, scott <scott@impulseuk.com> wrote:> > 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 > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060809/608e3128/attachment.html
Romeu Henrique Capparelli Fonseca
2006-Aug-09 12:14 UTC
RES: [Rails] select with country names
Hi, You can use country_select. Att., Romeu Fonseca -----Mensagem original----- De: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] Em nome de scott Enviada em: quarta-feira, 9 de agosto de 2006 05:10 Para: rails@lists.rubyonrails.org 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 Rails@lists.rubyonrails.org 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
Scott, Assuming your model Account has a country text attribute: <%= country_select :account, :country %> Hope this helps, Zack On 8/9/06, scott <scott@impulseuk.com> wrote:> 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 > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >