not compitable with our tech
This commit is contained in:
@@ -9,13 +9,11 @@ class ApplicationController < ActionController::Base
|
||||
#all token authentication must be done here
|
||||
#response format must be set to JSON
|
||||
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
|
||||
def current_user
|
||||
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
|
||||
end
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
class HomeController < ApplicationController
|
||||
skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
|
||||
# layout "application", except: [:index, :show]
|
||||
skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
|
||||
|
||||
def index
|
||||
@employees = Employee.all_emp_except_waiter.order("name asc")
|
||||
@login_form = LoginForm.new()
|
||||
render "layouts/initial", layout: false
|
||||
end
|
||||
|
||||
def show
|
||||
@login_form = LoginForm.new()
|
||||
@login_form.emp_id = params[:emp_id]
|
||||
render "layouts/initial", layout: false
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -23,7 +26,7 @@ class HomeController < ApplicationController
|
||||
else
|
||||
flash[:notice] ="Invalid PIN for Employee. Please try again!"
|
||||
render :show
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -69,6 +72,7 @@ class HomeController < ApplicationController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_home_params
|
||||
params.require(:login_form).permit(:emp_id, :password)
|
||||
|
||||
Reference in New Issue
Block a user