From d0a527d1eede422a1291665fa451feeebead377c Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 5 Sep 2017 13:53:06 +0630 Subject: [PATCH] code review and fix --- app/controllers/home_controller.rb | 9 +-------- app/views/home/dashboard.html.erb | 21 +++------------------ 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index ead69f39..54534c4f 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -58,14 +58,7 @@ class HomeController < ApplicationController end def dashboard - # if @employee && @employee.role == "cashier" - # - # elsif @employee && @employee.role == "waiter" - # elsif @employee && @employee.role == "administrator" - # elsif @employee && @employee.role == "manager" - # elsif @employee && @employee.role == "supervisour" - # redirect_to dashboard_path - # end + @shop = Shop.first end def destroy diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb index c211b8e6..0883cc92 100644 --- a/app/views/home/dashboard.html.erb +++ b/app/views/home/dashboard.html.erb @@ -1,18 +1,3 @@ -
-
- <% if current_login_employee.role == "admin" %> - - <% elsif current_login_employee.role == "cashier" %> - <%= link_to "Cashier Station", origami_path %> - <% elsif current_login_employee.role == "account" %> - <%= link_to "Cashier Station", oishi_path %> - <% else %> - <%= link_to "Cashier Station", oishi_path %> - <% end %> - <% shop = Shop.first %> -
-
-

Role Features

@@ -203,14 +188,14 @@
- <%= shop.address %> + <%= @shop.address %>
- <%= shop.phone_no %> + <%= @shop.phone_no %>