Problem with associating comments with blog posts on same page

Hi,

I will admit I am very new to ruby and I am trying to do something
that is not in any tutorials I have found. If you see a more
conventional way to do some of the things I am trying to do, please
let me know.

What I am trying to accomplish. People can edit the comments on the
same page as the listing of posts. The problem is that when I go to
create the comment, it is not getting associated with the post. I have
accomplished this on other pages through normal methods such as:

app/views/posts/show.html.erb
<% form_for [@post, Comment.new] do |f| %>

This successfully pulls the post id and saves the comment as belonging
to that post.

Now, when I try to incorporate everything all into a very easy page to
navigate I can’t use the same code associations and my comments fail.

app/views/posts/index.html.erb
<% div_for( post ) do %>

<%= link_to_unless_current h(post.title), statemant %>

Posted <%=h time_ago_in_words(post.created_at) %> ago

Approved: <%= h(post.approved) %>

<%= simple_format h(post.body) %>

<% randomNumber = rand(100000) %>
<%= render :partial => post.comments %>

New comment

<% form_for :comment, :url => { :controller => "comments", :action => :create} do |f| %> <%= f.error_messages %> <%= f.hidden_field(:post_id, :value => post.post_id) %>

<%= f.text_area :body %>

<%= f.submit 'Add your Comment' %>

<% end %>
<% end %>

Thanks for any help or pointers. I hope that you can understand what I
am trying to accomplish.

Justin