Module: Gatepass
- Defined in:
- app/controllers/gatepass/users_controller.rb,
lib/gatepass.rb,
lib/gatepass/engine.rb,
lib/gatepass/version.rb,
app/models/gatepass/user.rb,
app/helpers/gatepass/users_helper.rb,
app/jobs/gatepass/application_job.rb,
app/models/gatepass/application_record.rb,
app/helpers/gatepass/application_helper.rb,
app/mailers/gatepass/application_mailer.rb,
app/helpers/gatepass/authentication_helper.rb,
app/controllers/gatepass/application_controller.rb,
app/controllers/gatepass/authentication_controller.rb
Overview
Refactor the code to make it less repetitive
Defined Under Namespace
Modules: ApplicationHelper, AuthenticationHelper, UsersHelper Classes: ApplicationController, ApplicationJob, ApplicationMailer, ApplicationRecord, AuthenticationController, Engine, User, UsersController
Constant Summary collapse
- VERSION =
"0.1.2"
Instance Method Summary collapse
-
#check_authenticated ⇒ Object
Check if the user is defined in the session; if not, redirects to the login page.
Instance Method Details
#check_authenticated ⇒ Object
Check if the user is defined in the session; if not, redirects to the login page
6 7 8 9 10 |
# File 'lib/gatepass.rb', line 6 def check_authenticated if session[:user].nil? redirect_to gatepass.authentication_login_path ({ :controller => 'gatepass/authentication', :action => :login }) end end |