Created
October 3, 2016 21:27
-
-
Save lizdenhup/7f7f1ada189b802850d7817b53059b40 to your computer and use it in GitHub Desktop.
Helper methods for use in a Sinatra CRUD app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './config/environment' | |
class ApplicationController < Sinatra::Base | |
helpers do | |
def logged_in? | |
!!session[:id] | |
end | |
def current_user | |
User.find(session[:id]) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment