Hello there,

I have a blog that people can leave comments on.

I have used the following code to attempt to save the comment value to
the database:

  def comment

    @user = User.find(session[:user_id])

     Blogpost.find(params[:id]).comments.create(:id =>
params[:body], :user_id => session[:user_id])
     flash[:notice] = "Added your comment"
     redirect_to :action => "show", :id => params[:id]
  end

the values in the database are:
id
body
blogpost_id
user_id

ALl these values EXCEPT the body get populated.

Using my code above, can anyone see why the body isn't being stored?
(it just gets set as NULL)

Hope someone can help...
Thanks,

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to