ActiveScaffold complains about association

Posted by Bilal Aslam on Stack Overflow See other posts from Stack Overflow or by Bilal Aslam
Published on 2010-02-22T19:01:40Z Indexed on 2010/06/17 5:03 UTC
Read the original article Hit count: 384

I'm using ActiveScaffold to create an Admin UI.

  • I have two models: Post and Comments.
  • A Post has-many Comments, and a Comment belongs-to a post.
  • There's a validates_presences_of :text validation the Comment model.

The problem is that when I create a new Post from the Admin UI without creating a new Comment in the subform, ActiveScaffold complains about the validation. I can create the Post if I also create a Comment associated with it, which is not what I Want.

I can create a new Post manually from script/console.

What gives?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about associations