tap/app/controllers/application_controller.rb

20 lines
483 B
Ruby
Raw Normal View History

2014-11-06 14:46:59 +01:00
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
2014-11-06 18:30:53 +01:00
include SessionsHelper
2014-11-10 17:06:50 +01:00
include ProductsHelper
2014-11-10 17:50:11 +01:00
include OrdersHelper
2014-11-10 02:30:42 +01:00
private
# Confirms a logged-in user.
def logged_in_user
unless logged_in?
store_location
#flash[:danger] = "Please log in."
redirect_to login_url
end
end
2014-11-06 14:46:59 +01:00
end