On May 8, 5:15 pm, RubyonRails_newbie <[email protected]>
wrote:

>   def comment
>     @user = User.find(session[:user_id])
>     @blogpost = Blogpost.new
>     @blogpost = Blogpost.create(:body => params[:body], :user_id =>
> session[:user_id])
>
>      Blogpost.find(params[:id]).comments.create(params[:comment])
>
>      flash[:notice] = "Added your comment"
>
>      redirect_to :action => "show", :id => params[:id]
>

Unless user_id was part of the fields in params[:comment] you don't
seem to be setting the user id on the comment anywhere.

Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to