One more from a noob :) Hi everyone, I''m trying to pass two variables from the view (user entered data). Compare one field with a database entry, if same the second field should be saved in the database. :This is to let the user update his password: I know it can be done but the have no idea how to :( . Any help will be greatly appreciated. Thanks in advance -- Posted via http://www.ruby-forum.com/.
Hu Sushruth, You shouldn''t need to pass variables from the view exactly, the information is posted back to the controller and ends up in the @params hash. However, I suggest you take a look at the code for the Login generator. Try running this generator on a blank rails site, and you''ll be able to go over the code. It''s very simple (compared to the more robust salted hash version, or the login engine), and does exactly what you''re suggesting. Craig Sushruth blah wrote:>One more from a noob :) > >Hi everyone, > >I''m trying to pass two variables from the view (user entered data). >Compare one field with a database entry, if same the second field should >be saved in the database. :This is to let the user update his password: >I know it can be done but the have no idea how to :( . Any help will be >greatly appreciated. > >Thanks in advance > > >
craig wrote:> Hu Sushruth, > > You shouldn''t need to pass variables from the view exactly, the > information is posted back to the controller and ends up in the @params > hash. However, I suggest you take a look at the code for the Login > generator. Try running this generator on a blank rails site, and you''ll > be able to go over the code. It''s very simple (compared to the more > robust salted hash version, or the login engine), and does exactly what > you''re suggesting. > > CraigHey thanks Craig, I will try to use the login generator for now. I really wanted to develop the whole thing on my own (I know its like reinventing the wheel, so that i get a better understanding of the whole thing. Thanks again. -- Posted via http://www.ruby-forum.com/.
Look at the code one of the generators produces, get a grip on what it''s doing, and then see if you can re-write it in your own app. Use it as a reference. Once you''ve done that, you''ll have a much better footing for using the techniques you''ve seen to build your own customised system. You''ll see whaht works for you, and which bits you think are crap - and hopefully have better ideas to replace them! - james On 11/15/05, Sushruth blah <yehweh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> craig wrote: > > Hu Sushruth, > > > > You shouldn''t need to pass variables from the view exactly, the > > information is posted back to the controller and ends up in the @params > > hash. However, I suggest you take a look at the code for the Login > > generator. Try running this generator on a blank rails site, and you''ll > > be able to go over the code. It''s very simple (compared to the more > > robust salted hash version, or the login engine), and does exactly what > > you''re suggesting. > > > > Craig > > Hey thanks Craig, I will try to use the login generator for now. I > really wanted to develop the whole thing on my own (I know its like > reinventing the wheel, so that i get a better understanding of the whole > thing. Thanks again. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >