How to save has_one belongs_to models?

How can I save two models that have has_one and belongs_to
relationship to each other? I want to save both the models by using
script/console. TIA.