Browse Source

create dashboard controller and update root route to it.

master
Georg Hopp 10 years ago
parent
commit
2f2b7b7e5e
  1. 3
      app/assets/javascripts/dashboard.coffee
  2. 3
      app/assets/stylesheets/dashboard.scss
  3. 4
      app/controllers/dashboard_controller.rb
  4. 2
      app/helpers/dashboard_helper.rb
  5. 2
      app/views/dashboard/index.html.erb
  6. 4
      config/routes.rb
  7. 9
      test/controllers/dashboard_controller_test.rb

3
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/

3
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/

4
app/controllers/dashboard_controller.rb

@ -0,0 +1,4 @@
class DashboardController < ApplicationController
def index
end
end

2
app/helpers/dashboard_helper.rb

@ -0,0 +1,2 @@
module DashboardHelper
end

2
app/views/dashboard/index.html.erb

@ -0,0 +1,2 @@
<h1>Dashboard#index</h1>
<p>Find me in app/views/dashboard/index.html.erb</p>

4
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'

9
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
Loading…
Cancel
Save