I created an instance variable (@edit_id) in the user_controller the update action.
def update
......
@edit_id = 1
......
end
and I have an Active Record Callbacks in the user_model
has_many :details
after_update :create_user_details
......
private
def create_user_details
detail = user.details.build
detail.edit_id = @edit_id
#(this @edit_id is the user_controller update action
#created instance variable, but **@edit_id is nil**)
detail.save
end
I how use the instance variable in the callback action