On 4 August 2010 10:56, disruptive tech <[email protected]> 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
Is that from code inserted in the view at the same point as the collection_select? Please show the complete error trace and the code around the error, and confirm which line of code the error is on. Colin > > > 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. > > -- 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.

