I'm also trying this:
controller
----------
def new
@usr = Usr.new
@country_list = Country.find(:all, :order=>"country_name")
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @usr }
end
end
and in view
-----------
<%= collection_select(:country, :id, @country_list, :id, :country_name,
options ={:prompt => "-Select a cnt"}, :class =>"country") %>
I get the following on loading a new.html.erb
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
Any ideas? Thanks
B
--
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.