title: How to pass object id?
body: <p>I have a relationship between two models</p>
  
  <p>Category Model</p>
  
  <pre><code>class Category &lt; ActiveRecord::Base
     belongs_to :product
  end
  </code></pre>
  
  <p>Product Model</p>
  
  <pre><code>class Product &lt; ActiveRecord::Base
    has_many :categories
  end
  </code></pre>
  
  <p>I have <code>category_id</code> in products table but When I create a new product in my products table
  <code>category_id</code> is null. I am new to rails can anyone help please?</p>