Displaying 1 result from an estimated 1 matches for "saved_address".
2006 Feb 03
6
Saving a User Object while in the Address Controller
...figure out why.
I am trying to save an address id to a user object just after I create
the address.
This isn''t the exact code, but it shows what I am trying to do.
class AddressesController < ApplicationController
def create
@address = Address.new(params[:address])
saved_address = @address.save
@user = User.find(params[:id])
@user.address_id = @address.id
saved_user = @user.save
end
end
User.save keeps on returning false.
Any ideas why? I can access different attributes of the user, so I know
that the proper user is getting returned from the...