Figure 14-1. Creating a new user in the default form
While the sign-up will actually work—you can tell if you check the logs—the submission just gets redirected to the top-level page, which in this case is still the Rails welcome page. That’s not very helpful. (On the bright side, if the passwords don’t match, that warning will come through and the form reloads.)
Keep track of this first account—it will make things much simpler when it’s time later in the chapter to create an administrator.
Similarly you can log in. Well, you can almost log in. One side effect of using
session rather than
is that a route in config/routes.rb
needs to change from:
map.resource :session, :controller => 'session'
Otherwise, you’ll get a
While you’re in the routes.rb file, just
below the line for
map.signup '/signup', :controller => 'users', :action => 'new' map.login '/login', :controller => 'session', :action => 'new' map.logout '/logout', :controller => 'session', :action => 'destroy'
Figure 14-2. Logging in for the first time
A successful login, once again, returns the user ...