made some changes to the application controller, added a user controller, and am now about to start working on the login piece

This commit is contained in:
Ken Johnson
2013-04-24 18:09:43 -04:00
parent bdc7ff28cf
commit 5a992c3c1f
179 changed files with 120 additions and 22 deletions
+17 -1
View File
@@ -1,3 +1,19 @@
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticated
helper_method :current_user
# Our security guy keep talking about sea-surfing, cool story bro.
#protect_from_forgery
private
def current_user
@current_user ||= User.find_by_user_id(session[:user_id].to_s)
end
def authenticated
redirect_to root_url and reset_session if not current_user
end
end
+3 -1
View File
@@ -1,5 +1,7 @@
class SessionsController < ApplicationController
skip_before_filter :authenticated, :only => [:new]
def new
end
+4
View File
@@ -0,0 +1,4 @@
class UsersController < ApplicationController
def new
end
end