RailsCasts Pro episodes are now free!

Learn more or hide this

Patrick Shainin's Profile

GitHub User: Anatortoise

Site: www.liftingsea.com

Comments by Patrick Shainin

Avatar

Hi,
  In Rails 3, if you are failing validations due to validating the parent_id in the child model when parent.new_record? and therefore parent is not yet saved, here's a solution.

http://stackoverflow.com/questions/2102724/rails-nested-attributes-association-validation-failing