work on comments

This commit is contained in:
albert
2010-10-20 19:24:53 -04:00
parent d7eafdaaf5
commit f8b1bd3142
15 changed files with 184 additions and 44 deletions

View File

@@ -7,7 +7,7 @@ class SessionsController < ApplicationController
if User.authenticate(params[:name], params[:password])
@user = User.find_by_name(params[:name])
session[:user_id] = @user.id
redirect_to(params[:url] || posts_path, :notice => "You are now logged in.")
redirect_to(params[:url] || session[:previous_uri] || posts_path, :notice => "You are now logged in.")
else
redirect_to(new_session_path, :notice => "Password was incorrect.")
end