From 1ecee185d978d7b8a9ade89d8dc840fa87656860 Mon Sep 17 00:00:00 2001 From: David Gay Date: Sat, 13 Apr 2024 20:05:14 -0400 Subject: home controller --- app/controllers/home_controller.rb | 4 ++++ app/views/home/index.html.erb | 2 ++ config/routes.rb | 4 +--- test/controllers/home_controller_test.rb | 8 ++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 app/controllers/home_controller.rb create mode 100644 app/views/home/index.html.erb create mode 100644 test/controllers/home_controller_test.rb 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/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 a125ef0..06d8529 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,8 @@ Rails.application.routes.draw do - # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html - # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. # Can be used by load balancers and uptime monitors to verify that the app is live. get "up" => "rails/health#show", as: :rails_health_check # Defines the root path route ("/") - # root "posts#index" + root "home#index" end diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb new file mode 100644 index 0000000..6bd87f6 --- /dev/null +++ b/test/controllers/home_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class HomeControllerTest < ActionDispatch::IntegrationTest + test "gets index" do + get home_index_url + assert_response :success + end +end -- cgit v1.2.3