title: Can a one to many relationship in rails create a parent object?
body: <p>If I have an <code>category</code> class that has many <code>products</code> and each product would only have one category so that my models looked like this:</p>
  
  <pre><code>class Product &lt; ActiveRecord::Base
   belongs_to :category
  end
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>class Category &lt; ActiveRecord::Base
    has_many :products
  end
  </code></pre>
  
  <p>Then, from the <code>belongs_to</code> side of products, can I create a category_name in my Product Model using: <code>create_category</code>? How can I tell what auto-generated methods are available to me on the product side of things? </p>