Extracted source (around line #23):

20:     <%= f.text_field :email %>
21:   </p>
22:   <p>
23:     <%= collection_select(:country, :id, @country_list, :id, 
:country_name,
24: options ={:prompt => "-Select a cnt"}, :class =>"country") %>
25:     <%= f.label :country %><br />
26:     <%= f.text_field :country %>
RAILS_ROOT: /home/brett/RoR/Apps/OpenBenefit/benefit

Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/form_options_helper.rb:327:in
 
`options_from_collection_for_select'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/form_options_helper.rb:543:in
 
`to_collection_select_tag'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/form_options_helper.rb:162:in
 
`collection_select'
/home/brett/RoR/Apps/OpenBenefit/benefit/app/views/usrs/new.html.erb:23:in 
`_run_erb_app47views47usrs47new46html46erb'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/form_helper.rb:499:in
 
`fields_for'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/helpers/form_helper.rb:282:in
 
`form_for'
/home/brett/RoR/Apps/OpenBenefit/benefit/app/views/usrs/new.html.erb:3:in 
`_run_erb_app47views47usrs47new46html46erb'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/renderable.rb:34:in
 
`send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/renderable.rb:34:in
 
`render'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/base.rb:306:in 
`with_template'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/renderable.rb:30:in
 
`render'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/template.rb:205:in 
`render_template'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/base.rb:265:in 
`render'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/base.rb:348:in 
`_render_with_layout'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_view/base.rb:262:in 
`render'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1250:in
 
`render_for_file'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:942:in
 
`render_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:51:in
 
`render'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in
 
`ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in
 
`ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:51:in
 
`render'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/mime_responds.rb:135:in
 
`send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/mime_responds.rb:135
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/mime_responds.rb:179:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/mime_responds.rb:179:in
 
`respond'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/mime_responds.rb:173:in
 
`each'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/mime_responds.rb:173:in
 
`respond'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/mime_responds.rb:107:in
 
`respond_to'
/home/brett/RoR/Apps/OpenBenefit/benefit/app/controllers/usrs_controller.rb:38:in
 
`new'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:in
 
`send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:in
 
`perform_action_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:617:in
 
`call_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:610:in
 
`perform_action_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in
 
`perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in
 
`ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in
 
`ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in
 
`perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/rescue.rb:160:in
 
`perform_action_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/flash.rb:151:in
 
`perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in
 
`send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in
 
`process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in
 
`process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:391:in
 
`process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:386:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:438:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:87:in
 
`dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:121:in
 
`_call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:130
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
 
`cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in
 
`cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/head.rb:9:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in 
`synchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:114:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/reloader.rb:34:in
 
`run'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:108:in
 
`call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/rack/static.rb:31:in 
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:47:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `each'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/rack/log_tailer.rb:17:in 
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in 
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in 
`service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in 
`run'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3



disruptive tech wrote:
> Colin Law wrote:
>> On 4 August 2010 09:32, disruptive tech <[email protected]> wrote:
>>> � � �format.xml �{ render :xml => @usr }
>>>
>>> You have a nil object when you didn't expect it!
>>> You might have expected an instance of Array.
>>> The error occurred while evaluating nil.map
>> 
>> What happens if, rather than using collection select, you just display
>> the id and country name for each item in @country list?  Doing that
>> will prove that the data is ok.  I presume that the table has a
>> country_name column.
>> 
>> Colin
> 
> here is a read-out - the data is there...
> 
> Listing countries
> 
> Country name
> UK  Show  Edit  Destroy
> France  Show  Edit  Destroy
> Germany  Show  Edit  Destroy
> 
> 
> describe countries;
> +--------------+--------------+------+-----+---------+----------------+
> | Field        | Type         | Null | Key | Default | Extra          |
> +--------------+--------------+------+-----+---------+----------------+
> | id           | int(11)      | NO   | PRI | NULL    | auto_increment |
> | country_name | varchar(255) | YES  |     | NULL    |                |
> | created_at   | datetime     | YES  |     | NULL    |                |
> | updated_at   | datetime     | YES  |     | NULL    |                |
> +--------------+--------------+------+-----+---------+----------------+
> 4 rows in set (0.00 sec)
> 
> select * from countries;
> +----+--------------+---------------------+---------------------+
> | id | country_name | created_at          | updated_at          |
> +----+--------------+---------------------+---------------------+
> |  4 | UK           | 2010-08-02 16:37:43 | 2010-08-02 16:37:43 |
> |  5 | France       | 2010-08-02 16:37:51 | 2010-08-02 16:37:51 |
> |  6 | Germany      | 2010-08-04 08:20:03 | 2010-08-04 08:20:03 |
> +----+--------------+---------------------+---------------------+
> 3 rows in set (0.00 sec)

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

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to