I seem to be having an odd problem with the login page html on page 240. I've downloaded the code archive and checked the latest errata but still doesn't work, I don't know if there is an error in my controller that might be causing it?
The odd thing is the form isn't showing at all. I am getting the application html (header, footer, layout etc) but no login form is being displayed. Here's my code, if anyone has any suggestions I'd be very greatful!
login.rhtml
account_controller.rbCode:<% form_tag do %> <p>Please log in.</p> <p> <label>Username:</label> <%= text_field_tag 'login' %> </p> <p> <label>Password:</label> <%= password_field_tag 'password' %> </p> <p><%= submit_tag 'login' %></p> <% end %>
Code:class AccountController < ApplicationController def login if request.post? @current_user = User.find_by_login_and_password(params[:login], params[:password]) unless @current_user.nil? session[:user_id] = @current_user.id redirect_to :controller => 'story' end end end def logout end end




Bookmarks