O'Reilly logo

RailsSpace: Building a Social Networking Website with Ruby on Rails™ by Aurelius Prochazka, Michael Hartl

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Registering users

Now that we’ve built the database back-end to store RailsSpace user information, it’s time to make a registration page to collect it. This will involve all three parts of the MVC architecture. The registration view will be dynamically generated by embedded Ruby using a Rails function specialized for producing HTML forms to interact with models. Once the form is submitted, the controller will use the form data to create a User model object. What happens next depends on whether the user is valid according to the criteria that we set in Section 3.2 when creating the User model: Valid users will be saved, resulting in a successful registration, while invalid users will be sent by the controller back to the registration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required