From 28416a3375580d604a278f2c400b49b7247eddae Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 19 Jun 2018 20:43:23 +0300 Subject: [PATCH] Use singular controller --- app/controllers/admin/dashboard_controller.rb | 8 ++++++++ app/controllers/admin/dashboards_controller.rb | 9 --------- .../{dashboards/show.haml => dashboard/show.html.erb} | 0 config/routes.rb | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 app/controllers/admin/dashboard_controller.rb delete mode 100644 app/controllers/admin/dashboards_controller.rb rename app/views/admin/{dashboards/show.haml => dashboard/show.html.erb} (100%) diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb new file mode 100644 index 000000000..35efab599 --- /dev/null +++ b/app/controllers/admin/dashboard_controller.rb @@ -0,0 +1,8 @@ +module Admin + class DashboardController < BaseController + authorize_resource class: false + + def show + end + end +end \ No newline at end of file diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb deleted file mode 100644 index 52d82ea0a..000000000 --- a/app/controllers/admin/dashboards_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Admin - class DashboardsController < BaseController - authorize_resource class: false - - def show - redirect_to [:admin, :domains] if can? :show, Domain - end - end -end diff --git a/app/views/admin/dashboards/show.haml b/app/views/admin/dashboard/show.html.erb similarity index 100% rename from app/views/admin/dashboards/show.haml rename to app/views/admin/dashboard/show.html.erb diff --git a/config/routes.rb b/config/routes.rb index 6fe587caa..7e0e99815 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -149,6 +149,8 @@ Rails.application.routes.draw do # ADMIN ROUTES namespace :admin do + root 'dashboard#show' + resources :keyrelays resources :zonefiles resources :zones, controller: 'dns/zones', except: %i[show destroy] @@ -258,8 +260,6 @@ Rails.application.routes.draw do authenticate :user do mount Que::Web, at: 'que' end - - root 'dashboards#show' end devise_for :users