I have a model called Video that has many statuses. I want to create a status of each kind and add it to @video.statuses in the def create of VideosController.
In VideosController, I have:
def create @video = Video.new(params[:video]) Kind.all.each do |f| @video.statuses.new(:kind =>f, :kind_id=>f.id,:comment =>"", :time_comp => nil, :completed =>false, :video_id =>@video.id)
I think you probably want @video.statuses.create( .. ) so that the status objects will be saved. See the Rails Guide on ActiveRecord Associations for more detail.