Displaying 1 result from an estimated 1 matches for "children_nam".
Did you mean:
children_name
2007 Jan 23
0
validates_presence_of fields. in parent ok, but how in children?
...hat i try:
Model
-----------------------------------------------------
class Parent < ActiveRecord::Base
has_one :children
validates_presence_of :parent_name
def init!
self.build_children
end
end
class Children < ActiveRecord::Base
belongs_to :parent
validates_presence_of children_name
end
controller
------------------------------------------------------
@parent = session[:parent] ||= Parent.new
@parent.init!
@parent.save
=>
the absence of parent_name will be correctly shown @parent.errors
but i cant find the absence of children_name isnt it validated?
if parent_name is se...