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! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
spokra wrote:> 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!No need to add that field to the db. The password field can be given as: password_field :password and the password confirmation field given as: password_field :password_confirmation and add a validation in the model as validates_confirmation_of :password There will be only ''password'' field in the db. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Dec 26, 11:38 pm, Vidya Ramachandren <rails-mailing-l...@andreas- s.net> wrote:> spokra wrote: > > 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! > > No need to add that field to the db. > > The password field can be given as: > password_field :password > and the password confirmation field given as: > password_field :password_confirmation > and add a validation in the model as validates_confirmation_of :password > > There will be only ''password'' field in the db. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. On Dec 26, 11:38 pm, Vidya Ramachandren <rails-mailing-l...@andreas- s.net> wrote:> spokra wrote: > > 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! > > No need to add that field to the db. > > The password field can be given as: > password_field :password > and the password confirmation field given as: > password_field :password_confirmation > and add a validation in the model as validates_confirmation_of :password > > There will be only ''password'' field in the db. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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? On Dec 27, 8:00 am, spokra <spo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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. > > On Dec 26, 11:38 pm, Vidya Ramachandren <rails-mailing-l...@andreas- > > > > s.net> wrote: > > spokra wrote: > > > 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! > > > No need to add that field to the db. > > > The password field can be given as: > > password_field :password > > and the password confirmation field given as: > > password_field :password_confirmation > > and add a validation in the model as validates_confirmation_of :password > > > There will be only ''password'' field in the db. > > -- > > Posted viahttp://www.ruby-forum.com/.- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Dec 27, 2007, at 11:56 AM, spokra wrote:> > 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? > > > On Dec 27, 8:00 am, spokra <spo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> 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. >> >> On Dec 26, 11:38 pm, Vidya Ramachandren <rails-mailing-l...@andreas- >> >> >> >> s.net> wrote: >>> spokra wrote: >>>> 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! >> >>> No need to add that field to the db. >> >>> The password field can be given as: >>> password_field :password >>> and the password confirmation field given as: >>> password_field :password_confirmation >>> and add a validation in the model as >>> validates_confirmation_of :password >> >>> There will be only ''password'' field in the db. >>> -- >>> Posted viahttp://www.ruby-forum.com/.- Hide quoted text - >> >> - Show quoted text - > > >Doug Pfeffer Developer, dougp-MgrS+4Dm5XfSwzCxd0mQhNBPR1lH4CV8@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. On Dec 27, 9:04 am, Doug Pfeffer <do...-MgrS+4Dm5XfSwzCxd0mQhNBPR1lH4CV8@public.gmane.org> wrote:> 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 > > On Dec 27, 2007, at 11:56 AM, spokra wrote: > > > > > > > > > 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? > > > On Dec 27, 8:00 am, spokra <spo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> 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. > > >> On Dec 26, 11:38 pm, Vidya Ramachandren <rails-mailing-l...@andreas- > > >> s.net> wrote: > >>> spokra wrote: > >>>> 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! > > >>> No need to add that field to the db. > > >>> The password field can be given as: > >>> password_field :password > >>> and the password confirmation field given as: > >>> password_field :password_confirmation > >>> and add a validation in the model as > >>> validates_confirmation_of :password > > >>> There will be only ''password'' field in the db. > >>> -- > >>> Posted viahttp://www.ruby-forum.com/.-Hide quoted text - > > >> - Show quoted text - > > Doug Pfeffer > Developer, > do...-MgrS+4Dm5XfSwzCxd0mQhG0GvWLwp++3@public.gmane.org Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Um, why are you adding all of those attr_accessors? So you get access to the login field in the database? You do not need to do this! ActiveRecord does it for you! -- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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.. On Dec 27, 2007 4:12 PM, Ryan Bigg <radarlistener-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Um, why are you adding all of those attr_accessors? So you get access to the > login field in the database? You do not need to do this! ActiveRecord does > it for you! > > > -- > Ryan Bigg > http://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---