I am trying to add a new entry in my database for a model that has a belongs_to relationship. I have 2 models, Jobs and Clients.
It was easy enough to find tutorial
For creating new instances you could use factories. For this you could simply use FactoryGirl https://github.com/thoughtbot/factory_girl
So after you have defined your factory soewhat like this:
FactoryGirl.define do factory :job do client FactoryGirl.create(:client) subject 'Test' description 'This is a Test'
You could then call FactoryGirl.create(:job) to generate a new job like that. You could also call FactoryGirl.build(:job, client: aClientYouInstantiatedBefore, subject: 'AnotherTest') and also overwrite any other attributes
Factores are good if you want to create many objects, that are similar in a certain way.