diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0d95db2..ca8f9f2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,8 @@ class ApplicationController < ActionController::Base # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. allow_browser versions: :modern + + def hello + render html: "Hello World!" + end end diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb new file mode 100644 index 0000000..19f79a9 --- /dev/null +++ b/app/controllers/static_pages_controller.rb @@ -0,0 +1,10 @@ +class StaticPagesController < ApplicationController + def home + end + + def help + end + + def about + end +end diff --git a/app/helpers/static_pages_helper.rb b/app/helpers/static_pages_helper.rb new file mode 100644 index 0000000..2d63e79 --- /dev/null +++ b/app/helpers/static_pages_helper.rb @@ -0,0 +1,2 @@ +module StaticPagesHelper +end diff --git a/app/views/static_pages/about.html.erb b/app/views/static_pages/about.html.erb new file mode 100644 index 0000000..be7cbc1 --- /dev/null +++ b/app/views/static_pages/about.html.erb @@ -0,0 +1,2 @@ +
Find me in app/views/static_pages/about.html.erb
diff --git a/app/views/static_pages/help.html.erb b/app/views/static_pages/help.html.erb new file mode 100644 index 0000000..61896f5 --- /dev/null +++ b/app/views/static_pages/help.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/static_pages/help.html.erb
diff --git a/app/views/static_pages/home.html.erb b/app/views/static_pages/home.html.erb new file mode 100644 index 0000000..af94c7f --- /dev/null +++ b/app/views/static_pages/home.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/static_pages/home.html.erb
diff --git a/config/routes.rb b/config/routes.rb index 48254e8..43610ec 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,9 @@ Rails.application.routes.draw do + get "static_pages/home" + get "static_pages/help" + get "static_pages/about" + + root "application#hello" # 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. diff --git a/test/controllers/static_pages_controller_test.rb b/test/controllers/static_pages_controller_test.rb new file mode 100644 index 0000000..b336317 --- /dev/null +++ b/test/controllers/static_pages_controller_test.rb @@ -0,0 +1,19 @@ +require "test_helper" + +class StaticPagesControllerTest < ActionDispatch::IntegrationTest + test "should get home" do + get static_pages_home_url + assert_response :success + end + + test "should get help" do + get static_pages_help_url + assert_response :success + end + + test "Should get about" do + get static_pages_about_url + assert_response :success + end +end +