stadtratmonitor/app/controllers/application_controller.rb

26 lines
517 B
Ruby
Raw Normal View History

2020-03-09 12:13:27 +01:00
# frozen_string_literal: true
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
def current_user
User.find(session[:user_id]) if session[:user_id].present?
end
def signed_in?
!!current_user
end
2018-03-31 19:40:50 +02:00
def glossary
2020-03-09 12:13:27 +01:00
render action: 'glossary'
2018-03-31 19:40:50 +02:00
end
2018-03-31 17:22:42 +02:00
def impressum
2020-03-09 12:13:27 +01:00
render action: 'impressum'
2018-03-31 17:22:42 +02:00
end
helper_method :current_user, :signed_in?
end