is giving me the error, "ActiveRecord::AssociationTypeMismatch in
FormsController#create -- FormItem expected, got
HashWithIndifferentAccess". request passed in is
is giving me the error, "ActiveRecord::AssociationTypeMismatch in
FormsController#create -- FormItem expected, got
HashWithIndifferentAccess". request passed in is
Right now, you're going to have to iterate over params[:form_items]
creating activerecord objects as you go.
Maybe he wasn't getting an answer? I don't frequent the rails forum
and had I known the answer the only way I could have helped would have
been answering this post.
Sorry about that. You were perfectly clear, don't know why I missed
previous posting. Anyway this is the code I used that worked for
me ...
form_items_arr = Array.new
for form_item in params[:form_items]
form_item_obj = FormItem.new(form_item)
form_items_arr.push(form_item_obj)
end
@form = Form.new(:user_id => session[:user_id],
:form_items => form_items_arr)
All the best, - Dave
I'm getting an internal server error in my logs, saying
Status: 500 Internal Server Error
Conflicting types for parameter containers. Expected an instance of
Hash but found an instance of Array. This can be caused by colliding
Array and Hash parameters like qs=value&qs[key]=value.