# The associations model save error

**URL:** <https://www.ruby-forum.com/t/the-associations-model-save-error/134077>\
**Category:** Rails\
**Created:** [April 7, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/the-associations-model-save-error/134077 "2008-04-07T17:28:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent.Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@Vincent.Z](https://www.ruby-forum.com/u/Vincent.Z)\
**Post date:** [April 7, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/the-associations-model-save-error/134077/1 "2008-04-07T17:28:53Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Vincent.Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/90db22/32.png) [@Vincent.Z](https://www.ruby-forum.com/u/Vincent.Z)\
**Post date:** [April 7, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/the-associations-model-save-error/134077/2 "2008-04-07T23:18:31Z")

</div>

please post the form code
