From 7b216ee6a6e3132516640d1c12babe3e4b265ffc Mon Sep 17 00:00:00 2001 From: Adrian Hinz Date: Thu, 28 Sep 2017 22:45:36 +0200 Subject: [PATCH] Signed-off-by: Adrian Hinz --- Gemfile | 2 ++ app/assets/javascripts/home.coffee | 3 +++ app/assets/stylesheets/home.scss | 3 +++ app/controllers/home_controller.rb | 4 ++++ app/helpers/home_helper.rb | 2 ++ app/views/home/index.html.erb | 2 ++ config/routes.rb | 3 +++ test/controllers/home_controller_test.rb | 9 +++++++++ 8 files changed, 28 insertions(+) create mode 100644 app/assets/javascripts/home.coffee create mode 100644 app/assets/stylesheets/home.scss create mode 100644 app/controllers/home_controller.rb create mode 100644 app/helpers/home_helper.rb create mode 100644 app/views/home/index.html.erb create mode 100644 test/controllers/home_controller_test.rb diff --git a/Gemfile b/Gemfile index 4aa8f6b..8aac5db 100644 --- a/Gemfile +++ b/Gemfile @@ -12,6 +12,7 @@ gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views +gem 'coffee-script-source', '1.8.0' if Gem.win_platform? gem 'coffee-rails', '~> 4.2' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby @@ -44,5 +45,6 @@ group :development do gem 'spring-watcher-listen', '~> 2.0.0' end +gem 'wdm', '>= 0.1.0' if Gem.win_platform? # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/app/assets/javascripts/home.coffee b/app/assets/javascripts/home.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/home.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/home.scss b/app/assets/stylesheets/home.scss new file mode 100644 index 0000000..7131aac --- /dev/null +++ b/app/assets/stylesheets/home.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Home 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/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..95f2992 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,4 @@ +class HomeController < ApplicationController + def index + end +end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb new file mode 100644 index 0000000..23de56a --- /dev/null +++ b/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..2085730 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,2 @@ +

Home#index

+

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

diff --git a/config/routes.rb b/config/routes.rb index 787824f..555073c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,6 @@ Rails.application.routes.draw do + root 'home#index' + get 'home/index' + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb new file mode 100644 index 0000000..6013b68 --- /dev/null +++ b/test/controllers/home_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class HomeControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get home_index_url + assert_response :success + end + +end