Displaying 1 result from an estimated 1 matches for "validationvalidates_presence_of".
2007 Dec 22
3
collection_select validation problem
...ng error instead of the
Rails validates_presence_of error:
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
If I make a selection, everything works just fine. What do I need to
do to get the Rails validationvalidates_presence_of error?
Here''s the code:
MODEL
class Client < ActiveRecord::Base
has_many :programs
validates_presence_of :eid, :name
end
class Program < ActiveRecord::Base
belongs_to :client
validates_presence_of :client_id
validates_associated :client
end
CONTROLLERS
def new
@pr...