Simple question on inserting child data

after doing a bunch of reading I have finally sat down to create a simple app to dirve home a lor of the concepts to which have been read. So I figured a simple blog app is the best way to do it. The bad thing is that I am already hung up when creating replies to a blog posting.

I can't figure out how to insert the post_id value into the reply table. When creating a reply the user is directed to a page via a url simular to the following http://localhost:3000/main/reply/4, with the value 4 being the post_id that is being replied to.

In the controller I have:

class MainController < ApplicationController

  def index     #display a list of the posts     @posts = Post.find(:all, :order => "id desc")   end

  def reply     #display the post that is being replied to     @post = Post.find(params[:id])     @reply = Reply.new   end

  def post_reply     @reply = Reply.find(params[:id])     redirect_to :index   end

end