SHIMADA Koji
null+****@clear*****
Wed Sep 5 13:46:46 JST 2012
SHIMADA Koji 2012-09-05 13:46:46 +0900 (Wed, 05 Sep 2012) New Revision: b3189a5c1ad683cc57c0f30ff7d92781c043c1dc https://github.com/logaling/logaling-server/commit/b3189a5c1ad683cc57c0f30ff7d92781c043c1dc Merged 111235b: Merge branch 'add-user-authentication' into merge-add-user-authentication Log: Add authenticate to before filter for dashboard Modified files: app/controllers/application_controller.rb app/controllers/dashboard_controller.rb Modified: app/controllers/application_controller.rb (+8 -0) =================================================================== --- app/controllers/application_controller.rb 2012-09-05 13:38:51 +0900 (3fd079b) +++ app/controllers/application_controller.rb 2012-09-05 13:46:46 +0900 (93061a3) @@ -10,4 +10,12 @@ class ApplicationController < ActionController::Base def signed_in? !!current_user end + + def authenticate! + unless signed_in? + redirect_to root_path + else + true + end + end end Modified: app/controllers/dashboard_controller.rb (+2 -0) =================================================================== --- app/controllers/dashboard_controller.rb 2012-09-05 13:38:51 +0900 (b5083b3) +++ app/controllers/dashboard_controller.rb 2012-09-05 13:46:46 +0900 (fc9a42f) @@ -1,4 +1,6 @@ class DashboardController < ApplicationController + before_filter :authenticate! + def show end end -------------- next part -------------- An HTML attachment was scrubbed... 다운로드