Ruby on Rails DB Relation

For suppose I have three database table eg:

I assume that you are a newcomer to rails. You have not used the
rails convention for naming the primary id field in each table, which
is a bad idea, it is better to stick to the conventions unless there
is very good reason. I suggest before going further that you work
right through a good tutorial such as (which is free
to use online). That will show you the basics of rails. You will
recover the time spent on this very quickly.

However, back on the specific problem, you are looking at the problem
from the wrong end. You should not say "this are my tables, what
should the associations be", but rather "this is my problem, what are
the associations" from which you can design the tables. It looks from
your description of the problem that you want

Recruiter has_many companies

Company belongs_to recruiter
Company has_many posts

Post belongs_to company

But as I said, please work through the tutorial before going further.
Also look at the Rails Guides.