test/dummy/app/controllers/application_controller.rb in pulitzer-0.0.1 vs test/dummy/app/controllers/application_controller.rb in pulitzer-0.0.2
- old
+ new
@@ -1,5 +1,19 @@
class ApplicationController < ActionController::Base
+ before_filter :setup_user
+
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+
+ def setup_user
+ @current_user = User.new
+ @current_user.admin = true
+ # if params[:admin]
+ # @current_user.admin = true
+ # end
+ end
+
+ def current_user
+ @current_user
+ end
end