From 052d5e8c9c6f918be153eff0417be8125fed7629 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Thu, 12 Jul 2018 15:07:52 +0630 Subject: [PATCH] Edit dashboard ligin --- app/controllers/home_controller.rb | 4 +- app/views/layouts/login_dashboard.html.erb | 145 ++++----------------- 2 files changed, 30 insertions(+), 119 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 4e0e89f3..11ed3da0 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -20,7 +20,9 @@ class HomeController < ApplicationController def index # @employees = Employee.all_emp_except_waiter.order("name asc") @employees = Employee.all.where("is_active = true").order("name asc") - @roles = Lookup.collection_of("employee_roles") + @roles = Employee.distinct.pluck(:role) + # byebug + # @roles = Lookup.collection_of("employee_roles") @login_form = LoginForm.new() render "layouts/login_dashboard", layout: false end diff --git a/app/views/layouts/login_dashboard.html.erb b/app/views/layouts/login_dashboard.html.erb index a48479ed..10d9def1 100755 --- a/app/views/layouts/login_dashboard.html.erb +++ b/app/views/layouts/login_dashboard.html.erb @@ -113,9 +113,9 @@