Forum: Ruby on Rails Passing variables from view to controller(s)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
66a129f44912c5c466733283ef8ba8d1?d=identicon&s=25 Sushruth Blah (yehweh)
on 2005-11-15 06:22
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
8a456610e31c8feadc4cef71d9347cbd?d=identicon&s=25 craig (Guest)
on 2005-11-15 06:42
(Received via mailing list)
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
66a129f44912c5c466733283ef8ba8d1?d=identicon&s=25 Sushruth Blah (yehweh)
on 2005-11-15 07:16
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.
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 james.adam (Guest)
on 2005-11-15 12:20
(Received via mailing list)
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
This topic is locked and can not be replied to.