guoren/app/controllers/application_controller.rb

16 lines
304 B
Ruby
Raw Normal View History

2016-12-22 20:00:08 +08:00
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
2016-12-26 11:00:51 +08:00
include ApplicationHelper
2016-12-22 20:00:08 +08:00
include LoginHelper
# Confirms a logged-in user.
def logged_in_user
unless logged_in?
flash[:danger] = "请先登录"
redirect_to login_url
end
end
end