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 ...
Get RailsSpace: Building a Social Networking Website with Ruby on Rails™ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.