Im very new to Ruby on rails. I am trying to set a Product object (:userid) to the user object id (user.id). So far I have got this 

```
class Product < ActiveRecord::Base
  before_create :set_userid
  def set_userid
    self.userid = User.new(params[:id])
  end
end

```

Is there any other way to set the value before the product object is created?