Ruby On Rails - How Do I Make User Login? (Authentication)?
Hello, thanks for reading my question. I recently played with Ruby on Rails and found its simplicity a blessed. I heard that Base Camp, 43 Folders are also created with Ruby on Rails, and I wonder, can I also make a user login authentication for my own site?
Thank You!
Thank You!
The simplest way is to create a table in the DB for Users. Then, set up a before_filter to catch any traffic coming to a restricted page. Save the requested URL. Ask for the user name and password. Check the DB to see if it's valid. Redirect to the originally requested URL.
There are examples of this in the Agile Web Development book as well as some of the help pages, but I forget where exactly.
Best of luck.
There are examples of this in the Agile Web Development book as well as some of the help pages, but I forget where exactly.
Best of luck.
The simplest way is to create a table in the DB for Users. Then, set up a before_filter to catch any traffic coming to a restricted page. Save the requested URL. Ask for the user name and password. Check the DB to see if
it's valid. Redirect to the originally requested URL.
There are examples of this in the Agile Web Development book as well as some of the help pages, but I forget where exactly.
Best of luck.
There are examples of this in the Agile Web Development book as well as some of the help pages, but I forget where exactly.
Best of luck.