Q: Categories specified in the model are not uploading to the database I want to know what I'm doing wrong as my Categories "name" that I specify on rails console are not uploading directly to my postgresql database.
My first Model (category.rb)file
class Category < ApplicationRecord
  attr_accessible :name
  has_many :content
end

My Second Model (content.rb)file
class Content < ApplicationRecord
  attr_accessible :title, :body, :category_id, :author_id
  belongs_to :category
end

I've added two categories inside this model 
"Football" and Cricket using the code below:
category = Category.create(:name => "Football")
category = Category.create(:name => "Cricket")

The above code creates category id and tables in the postgresql not the name I specified.
Please help.. Please reply if you need anything else

A: class Category < ApplicationRecord
  attr_accessible :name
  # has_many :content -- This is wrong
  has_many :contents # This is how it should be
end

Also has hashrocket suggested try running migration.
What is the result of running the following in console?
c = Category.new
c.name = "football"
c.save

If this gives you an error then going through the error message will show what is wrong.
