form field without column in DB

I'm using authenticated gem and adding turing to it.. I'd like to pass a form variable back to the controller. but there is no need to keep it in the DB. the form renders fine the initial time. but fails if it fails when the controller tries to display the form with data when the user gives bad input.. password and password confirm don;t match. should i just add the field to the db or is there a better way?

last newbie question for tonight!! Thanks for all the help!

so if i have a session variable session['turing'] and submit turing_confirmation will the

validates_confirmation_of :turing

catch it? or will i have to get the session variable into a local variable some how? my guess would be to put :turing=session['turing'] in the controller..

and i take it i will have to add :turing to the list in.

attr_accessible :login, :email, :password, :password_confirmation, :turing_configure

ok I put turing=session['turning'] in my controller, added a turing_confirmation field to the view and the validates_confirmation_of :turning to the model.

now i get the folling error! undefined method `turing' for #<Accounts:0xa6fef0c8>

I assume that this is being caused because AR is thinking that it should be putting turing into a column of the DB. how do I tell AR that it shouldn;t do that?

turing and turing_confirmation are not in the DB they are just there to perform Captcha on the creation of the account.

Hmmm adding a method of turing in the model got rid of the error!!

but the validate is not working. I stuffed the session variable turing into the params like this in the controller

params[:turing] = session['turing']

My thinking is AR knows how to find the submited form.. so i would add it from the controller... Am i going down the wrong path here?

I'm a carpy programmer if i was in php I would just output both turing and turing_confirmation in a debug statement in my code.. other then learning how to use the debugger how can a verify that I'm getting the variables set correctly?

The Account model needs a setter method in order to have the turing value assigned to it, which it sounds like you’ve done.

How are you assigning the values to the model object, in the controller?

Doug

well i just tried

params[:accounts] = {:turing => session['turing']}

which whipes out all the other values in the hash.. I got the ruby_debugger installed and now can view the application while its running.

no I'm not trying to get the turing to the db.. the text of the turing in in a session variable. and the form returns the users confirmation of the turing image. I just want to use active records to verify the two..