I got a form that feeds data to 2 models: Topic and Post.
@topic = Topic.new(params[:topic])
@post = Post.new(params[:post])
@post.topic_id = @topic.id
Now if there is an error in the Topic data RoR will catch it. But if
the Post fails validation the Topic still gets created. So what would
like to do is doing a test on each object and then save.
Did google the topic but did not hit the nail on the head.