Rails II
3 credits
| Application created with User authentication | 10 |
| Login and Registration page created | 10 |
| L.R. page allows users to register | 25 |
| L.R. page allows users to login | 25 |
| L.R. page does not show password confirmation field if users email address is already registered | 15 |
| L.R. page does show password confirmation field if users email address is not already registered | 15 |
| Total | 100 pts |
To create a combination login / registration page
For this lab you will create a single page that will allow a new user to register or a current user to login. What will make this interesting is that the page will only have a single form which needs to customize itself based on the information it is being given.
The setup is that users registering for our website need to provide an email address, password, and password confirmation. Users who have registered and are logging in need to provide their email address and password but no password confirmation. Because of the similarity in these two things we've decided to combine the login and registration forms into one.
On the login/registration page when the user provides their email address the system will need to decide if that email address belongs to a registered user or not. If there is already a registered user with that address then they are probably trying to login, so the password confirmation field should disappear and the form should submit for logging in. If the email address that the user is entering is not known to the system then it must be for a new user who needs to register, so the password confirmation field should be shown and the form should submit for creating a new user.