There are a few ways to do this.
In db/seeds.rb add something like:
form = Forum.create(attributes {})
form.topics.create(attributes{})
or
form = Forum.create(attributes {})
topic1 = Topic.create(attributes{})
topic2 = Topic.create(attributes{})
form.topics << topic1
form.topics << topic2
Then when you want to seed your db just run:
rake db:seed