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
|