the associations model save error

i have the A and B model which has associations as follows:

A has_one B

B belongs_to A

so,when i use the form_for tag to input date to model A,i get error as follows:

B expected, got HashWithIndifferentAccess

code: @a=A.new(params[:a])

thanks!