mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-06-08 01:08:38 +02:00
Start with a Rails app with authentication via Persona, Foundation CSS
This commit is contained in:
parent
9ac52066b4
commit
7cd9f207f5
72 changed files with 2586 additions and 0 deletions
15
app/controllers/application_controller.rb
Normal file
15
app/controllers/application_controller.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
|
||||
helper_method :current_user, :signed_in?
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue