From 2f2b7b7e5e5b0cdfd242d50e8052a50f74a1e7fd Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Tue, 19 Apr 2016 11:40:16 +0200 Subject: [PATCH] create dashboard controller and update root route to it. --- app/assets/javascripts/dashboard.coffee | 3 +++ app/assets/stylesheets/dashboard.scss | 3 +++ app/controllers/dashboard_controller.rb | 4 ++++ app/helpers/dashboard_helper.rb | 2 ++ app/views/dashboard/index.html.erb | 2 ++ config/routes.rb | 4 +++- test/controllers/dashboard_controller_test.rb | 9 +++++++++ 7 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/dashboard.coffee create mode 100644 app/assets/stylesheets/dashboard.scss create mode 100644 app/controllers/dashboard_controller.rb create mode 100644 app/helpers/dashboard_helper.rb create mode 100644 app/views/dashboard/index.html.erb create mode 100644 test/controllers/dashboard_controller_test.rb diff --git a/app/assets/javascripts/dashboard.coffee b/app/assets/javascripts/dashboard.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/dashboard.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss new file mode 100644 index 0000000..e8f34fd --- /dev/null +++ b/app/assets/stylesheets/dashboard.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Dashboard controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb new file mode 100644 index 0000000..391fa2e --- /dev/null +++ b/app/controllers/dashboard_controller.rb @@ -0,0 +1,4 @@ +class DashboardController < ApplicationController + def index + end +end diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb new file mode 100644 index 0000000..a94ddfc --- /dev/null +++ b/app/helpers/dashboard_helper.rb @@ -0,0 +1,2 @@ +module DashboardHelper +end diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb new file mode 100644 index 0000000..8179f3e --- /dev/null +++ b/app/views/dashboard/index.html.erb @@ -0,0 +1,2 @@ +

Dashboard#index

+

Find me in app/views/dashboard/index.html.erb

diff --git a/config/routes.rb b/config/routes.rb index 3f66539..9f05377 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,11 @@ Rails.application.routes.draw do + get 'dashboard/index' + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". # You can have the root of your site routed with "root" - # root 'welcome#index' + root 'dashboard#index' # Example of regular route: # get 'products/:id' => 'catalog#view' diff --git a/test/controllers/dashboard_controller_test.rb b/test/controllers/dashboard_controller_test.rb new file mode 100644 index 0000000..5cad26b --- /dev/null +++ b/test/controllers/dashboard_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class DashboardControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + +end